Ticket #7009 (closed bug: fixed)
Reformat minDate/maxDate when dateFormat changes
|Reported by:||mystic414||Owned by:|
The minDate/maxDate properties are assumed to be in the same date format as the dateFormat of the datepicker. If the datepicker is later updated to use a new dateFormat, minDate/maxDate remain in the old format and are not used properly by the datepicker.
I submitted a pull request with a fix: https://github.com/jquery/jquery-ui/pull/131
With this change, when a new dateFormat is specified, minDate/maxDate are reformatted with the new date format. This allows the datepicker to parse those dates correctly and properly restrict the range of the datepicker.
I set up a demo at the following sites. bad.html uses the unpatched datepicker and good.html uses the patched one:
The datepicker on the demo pages sets a range from Feb. 10 - Feb 20. When you click the button to change the dateFormat, the datepicker range gets corrupted in bad.html but not in good.html.
I think this patch might also fix ticket:5632.