jQuery UI Datepicker v3.4
Tags: jQuery, My Work | Written on 21/2/08
jQuery UI Datepicker has been updated to v3.4 - view the v3.4 change log for a full list of changes.
Many functions have been renamed and will stay this way. There was much discussion around the API of the jQuery UI project. It was decided that the name of the plug in will be the main function and the first parameter will be the actions.
To migrate fully, the following steps need to be taken:
- Replace
attachDatepickerwithdatepicker. - Replace
removeDatepicker()withdatepicker('destroy'). - Replace
changDatepicker(...)withdatepicker('change', ...). - Replace
enableDatepicker()withdatepicker('enable'). - Replace
disableDatepicker()withdatepicker('disable'). - Replace
isDisabledDatepicker()function withdatepicker('isDisabled'). - Replace
showDatepicker()function withdatepicker('show'). - Replace
getDatepickerDate()function withdatepicker('getDate'). - Replace
setDatepickerDate(...)function withdatepicker('setDate', ...).
For example, this old style code:
JavaScript:
$('inputs').attachDatepicker(...); $('inputs').changeDatepicker(...);
becomes:
JavaScript:
$('inputs').datepicker(...); $('inputs').datepicker('change',...);
I have come to love the new API - it fits with jQuery much better, don't you think?
Also, on the top of the datepicker documentation page you will notice links to legacy versions documentation for v3.2 and v3.3. That way if you don't need to migrate over to the new API right away you don't have to, while still having documentation.
Comments