Skip to main content

Search and Top Navigation

#4870 closed bug (fixed)

Opened September 22, 2009 12:04PM UTC

Closed December 01, 2009 01:31AM UTC

Last modified January 17, 2010 06:06AM UTC

yearRange doesn't work as expected

Reported by: mg Owned by:
Priority: minor Milestone: 1.8
Component: ui.datepicker Version: 1.7.2
Keywords: yearRange, datepicker Cc: mg@artigo.pl, mh@artigo.pl
Blocked by: Blocking:
Description

The bug occurs when one uses relative yearRange values with option changeYear: true, for example:

yearRange: '-100:+0',
changeYear: true,

With this example configuration list of years gets broken after date selection:

1. List is 1909-2009

2. We select 1909

3. List is now 1809-1909

4. We cannot select above 1909 - Bug

Attachments (3)
Change History (3)

Changed October 20, 2009 03:23PM UTC by BMCouto comment:1

It is a bug indeed, but it can be easily solved with something like:

yearRange: '-120:' + new Date().getFullYear()

Anyway it's something that should be fixed.

Replying to [ticket:4870 mg]:

The bug occurs when one uses relative yearRange values with option changeYear: true, for example:
> yearRange: '-100:+0',
> changeYear: true,
> 
With this example configuration list of years gets broken after date selection: 1. List is 1909-2009 2. We select 1909 3. List is now 1809-1909 4. We cannot select above 1909 - Bug

Changed November 16, 2009 08:04PM UTC by jzaefferer comment:2

milestone: TBD1.8

Changed December 01, 2009 01:31AM UTC by kbwood comment:3

resolution: → fixed
status: newclosed

Fixed in r3485. Year range now has three formats: 'c-n:c+n' for years relative to the currently displayed year, '-n:+n' for years relative to today's year, 'nnnn:nnnn' absolute years, and the default value has changed to 'c-10:c+10' to retain backward compatibility. These formats may be mixed for the start and end of the range, e.g. '2000:-5'.