Ticket #7009 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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.

Change History

comment:1 Changed 3 years ago by Adam Parod

  • Status changed from new to closed
  • Resolution set to fixed

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

Changeset: 74b7c3f684f5d83effcee6d5099c6fffb020fdf9

comment:2 Changed 3 years ago by Adam Parod

Datepicker: Reformat minDate/maxDate when dateFormat changes. Fixes #7009 - Reformat minDate/maxDate when dateFormat changes. (cherry picked from commit 74b7c3f684f5d83effcee6d5099c6fffb020fdf9)

Changeset: 12d38b1886b1e4a17d3bd018f028f7fa2b821229

comment:3 Changed 3 years ago by scott.gonzalez

  • Milestone changed from 1.9 to 1.8.11
Note: See TracTickets for help on using tickets.