Opened 10 years ago

Closed 10 years ago

#4567 closed bug (wontfix)

changeYear setting results in truncated list of options in the drop-down

Reported by: badikumar Owned by:
Priority: major Milestone: 1.8
Component: ui.datepicker Version: 1.7.1
Keywords: Cc: badikumar@…
Blocked by: Blocking:

Description

I have the following setting:

$.datepicker.setDefaults({ changeYear: true, yearRange: '-80:+10' });

$("#dateOfBirth").datepicker({ maxDate: '-16y', minDate: '-80y' });

With this setting, the drop down list shows the options from 1929 to 1993. Say, now I choose 1929 and click the drop down again, I only see 10 options in the list from 1929 to 1939-- that is 10 values ahead of the current selection-- and the rest of the options in the drop-down list have disappeared!

In this example, this problem appears only if the values before 1983 are selected. The option list starts getting truncated so that options that are only upto 10 years ahead of the current selection are shown.

Attachments (1)

changeyearproblem.JPG (9.0 KB) - added by badikumar 10 years ago.
snapshot of the problem

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by badikumar

Attachment: changeyearproblem.JPG added

snapshot of the problem

comment:1 Changed 10 years ago by Jörn Zaefferer

Milestone: TBD1.8

comment:2 Changed 10 years ago by kbwood

Resolution: wontfix
Status: newclosed

Setting the yearRange to '-80:+10' indicates years relative to the selected date. This is further constrained by any minimum/maximum dates. Thus you only see 1929 to 1939 when a date in 1929 is selected. You should probably set the yearRange to '1929:1993' instead.

Note: See TracTickets for help on using tickets.