Opened 13 years ago
Closed 11 years ago
#5473 closed bug (fixed)
Datepicker: Date range demo bug when clearing date
Reported by: | mattac | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.1 |
Component: | ui.datepicker | Version: | 1.8 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I'd like to suggest an improvement to the date range limiting implementation listed here:
http://jqueryui.com/demos/datepicker/#event-search
The current implementation has a bug. If a date is selected in one field and then cleared out, the date limiting will remain for the other field. Using an onClose handler rather than onSelect enables removing the min/maxDate setting on the other field.
See the following:
onClose: function(selectedDate) { if (selectedDate) { var option = this.id == "from" ? "minDate" : "maxDate"; var instance = $(this).data("datepicker"); var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings); dates.not(this).datepicker("option", option, date); } else { dates.not(this).datepicker("option", option, null); } }
Change History (2)
comment:1 Changed 11 years ago by
Milestone: | TBD → 1.9.1 |
---|---|
Summary: | "Event Search" documentation bug fix → Datepicker: Date range demo bug when clearing date |
comment:2 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Datepicker demo: Fixed date range restriction when clearing dates. Fixes #5473 - Datepicker: Date range demo bug when clearing date.