jQuery UI Datepicker v3.4: jQuery, My Work

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 attachDatepicker with datepicker.
  • Replace removeDatepicker() with datepicker('destroy').
  • Replace changDatepicker(...) with datepicker('change', ...).
  • Replace enableDatepicker() with datepicker('enable').
  • Replace disableDatepicker() with datepicker('disable').
  • Replace isDisabledDatepicker() function with datepicker('isDisabled').
  • Replace showDatepicker() function with datepicker('show').
  • Replace getDatepickerDate() function with datepicker('getDate').
  • Replace setDatepickerDate(...) function with datepicker('setDate', ...).

For example, this old style code:

JavaScript:
  1. $('inputs').attachDatepicker(...);
  2. $('inputs').changeDatepicker(...);

becomes:

JavaScript:
  1. $('inputs').datepicker(...);
  2. $('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

#1. Richard D Worth on 26/2/08
Great job Marc. I'm very impressed with your responsiveness (and patience) with all the API changes. Also, providing the legacy documentation is huge. Keep up the great work!
#2. Rey Bang on 26/2/08
Awesome job Marc. The datepicker rocks :)
#3. Luke on 16/4/08
Do you still intend to have the datepicker make use of the dateJs library? I think that would be a great way to reduce the size of the date picker code.
#4. Philip on 10/5/08
Hi Marc I've been using this plugin since the early days - it just keeps getting smoother - many thanks for all your hard work. Are there any plans to implement a time element? Even as a text box or optional plugin hook would be fine. Just need to be able to populate datetime fields sometimes...
#5. Tian on 19/6/08
Hi Marc, Thanks for a very nice tool. There's only ONE thing I'd really like to have: the ability to select multiple, discrete dates. OK, make that two things: better documentation on the options. There does not appear to be a single page with all the options, or even any documentation on most of the options. One is reduced to scrounging around the examples or peering into the ui.datepicker.js source to figure out what the options are. Keep up the good work!
#6. Marc Grabanski on 26/6/08
Tian, try clicking the options tab on the main function's datepicker documentation page.

Leave a Comment