Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4870 closed bug (fixed)

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@…, mh@…
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

Change History (3)

comment:1 in reply to: ↑ description Changed 7 years ago by BMCouto

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 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

comment:2 Changed 7 years ago by jzaefferer

  • Milestone changed from TBD to 1.8

comment:3 Changed 7 years ago by kbwood

  • Resolution set to fixed
  • Status changed from new to closed

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'.

Note: See TracTickets for help on using tickets.