#7956 closed bug (fixed)
Datepicker: maxDate - last month - ctrl+arrow shortcut doesn't work properly
| Reported by: | Macavelli | Owned by: | scottgonzalez |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.12.0 |
| Component: | ui.datepicker | Version: | 1.8.17 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
Hi,
there's a bug in jQuery.Datepicker. Shortcuts don't work properly, when you go to last avilable month.
Scenario:
- Set in the datepicker code option: maxDate: "+12m" (as below in the code section)
- Click on the input
- press Page Up till you get to the last month (december 2012 in this case, since we've got 15.12.2011)
- then try to press ctrl + left arrow - the selected date is going to be 14.11 (november) instead of 14.12 (december)
- try to press Page Up again to get to 15.12.2012 - then press Page Down - the selected date should be 15.11.2012, but it's 2 months before (not 1) - 15.10.2012.
jQuery code: $(document).ready(function() {
$("#datepicker").datepicker( {
numberOfMonths: 2, showButtonPanel: true, minDate: 0,
showOn: 'both', changeMonth: false, maxDate: "+12m", showOtherMonths: false, selectOtherMonths: true, hideIfNoPrevNext: true,
});
});
[...]
<input type="text" id="datepicker" />
Conclusion: There are 2 issues,
- ctrl + arrows: +-1 day selection in the last available date
- page down +-1 month
Any ideas? is it configuration issue or jQuery bug?
Change History (6)
comment:1 Changed 4 years ago by scottgonzalez
- Milestone changed from 1.9.0 to 1.11.0
comment:2 Changed 4 years ago by mikesherov
- Status changed from new to open
comment:3 Changed 3 years ago by tj.vantoll
#9474 is a duplicate of this ticket.
comment:4 Changed 3 years ago by tj.vantoll
- Milestone changed from 1.11.0 to none
- Summary changed from Datepicker shortcuts: maxDate - last month - ctrl+arrow dont work properly to Datepicker: maxDate - last month - ctrl+arrow shortcut doesn't work properly
From #9474 (there's also an explanation of a proposed fix).
Bug Example: http://jsbin.com/edutah/6/ Fix: http://jsbin.com/edamig/1/ Fix Example: http://jsbin.com/emufuq/1/
comment:5 Changed 8 months ago by scottgonzalez
- Owner set to scottgonzalez
- Resolution set to fixed
- Status changed from open to closed
In bf5d6f3:
comment:6 Changed 8 months ago by scottgonzalez
- Milestone changed from none to 1.12.0
confirmed: http://jsfiddle.net/uLJcc/