Ticket #4647 (closed bug: fixed)
setDate cannot be called multiple times
| Reported by: | babaker | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.8 |
| Component: | ui.datepicker | Version: | 1.7.2 |
| Keywords: | datepicker setDate | Cc: |
Description
It is only possible to call setDate once. Any subsequent calls are ignored and the calendar does not refresh. For example, on any of the datepicker demos, type the following in the firebug console:
$("#datepicker").datepicker("setDate","+1m");
The calendar will change as expected (in this case it went from June to July). But if you call that function again, nothing will happen. Interestingly, if you setDate "-1m", it will jump all the way back to the month previous to the month that was initially displayed on the page (in my case it went all the way from July to May).
The workaround for this is to use the following which appears to work fine: $.datepicker._adjustdate("#datepicker",+1,"M");
![(please configure the [header_logo] section in trac.ini)](/chrome/site/nologo.gif)