Skip to main content

Search and Top Navigation

#7009 closed bug (fixed)

Opened February 17, 2011 10:44PM UTC

Closed March 07, 2011 02:35PM UTC

Last modified March 07, 2011 02:36PM UTC

Reformat minDate/maxDate when dateFormat changes

Reported by: mystic414 Owned by:
Priority: minor Milestone: 1.8.11
Component: ui.datepicker Version: 1.8.9
Keywords: Cc:
Blocked by: Blocking:
Description

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:

http://74.51.109.35/jquery/bad.html

http://74.51.109.35/jquery/good.html

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.

Attachments (0)
Change History (3)

Changed March 07, 2011 02:35PM UTC by Adam Parod comment:1

resolution: → fixed
status: newclosed

Datepicker: Reformat minDate/maxDate when dateFormat changes. Fixes #7009 - Reformat minDate/maxDate when dateFormat changes.

Changeset: 74b7c3f684f5d83effcee6d5099c6fffb020fdf9

Changed March 07, 2011 02:35PM UTC by Adam Parod comment:2

Datepicker: Reformat minDate/maxDate when dateFormat changes. Fixes #7009 - Reformat minDate/maxDate when dateFormat changes.

(cherry picked from commit 74b7c3f684f5d83effcee6d5099c6fffb020fdf9)

Changeset: 12d38b1886b1e4a17d3bd018f028f7fa2b821229

Changed March 07, 2011 02:36PM UTC by scottgonzalez comment:3

milestone: 1.91.8.11