Skip to main content

Search and Top Navigation

#7956 closed bug (fixed)

Opened December 15, 2011 12:21PM UTC

Closed March 30, 2016 01:43PM UTC

Last modified March 30, 2016 01:43PM UTC

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:

1. Set in the datepicker code option: maxDate: "+12m" (as below in the code section)

2. Click on the input

3. press Page Up till you get to the last month (december 2012 in this case, since we've got 15.12.2011)

4. then try to press ctrl + left arrow - the selected date is going to be 14.11 (november) instead of 14.12 (december)

5. 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,

1. ctrl + arrows: +-1 day selection in the last available date

2. page down +-1 month

Any ideas?

is it configuration issue or jQuery bug?

Attachments (0)
Change History (6)

Changed October 11, 2012 02:43PM UTC by scottgonzalez comment:1

milestone: 1.9.01.11.0

Changed October 19, 2012 08:17PM UTC by mikesherov comment:2

status: newopen

Changed August 07, 2013 09:46PM UTC by tj.vantoll comment:3

#9474 is a duplicate of this ticket.

Changed August 07, 2013 09:48PM UTC by tj.vantoll comment:4

milestone: 1.11.0none
summary: Datepicker shortcuts: maxDate - last month - ctrl+arrow dont work properlyDatepicker: 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/

Changed March 30, 2016 01:43PM UTC by scottgonzalez comment:5

owner: → scottgonzalez
resolution: → fixed
status: openclosed

In [changeset:"bf5d6f314b3798094efdca4b73e09233f2a69d7d" bf5d6f3]:

#!CommitTicketReference repository="" revision="bf5d6f314b3798094efdca4b73e09233f2a69d7d"
Datepicker: Fixed keyboard navigation

Fixes #7956
Closes gh-1677

Changed March 30, 2016 01:43PM UTC by scottgonzalez comment:6

milestone: none1.12.0