Ticket #4870 (closed bug: fixed)

Opened 12 months ago

Last modified 8 months ago

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

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

datepicker1.png Download (13.9 KB) - added by mg 12 months ago.
datepicker2.png Download (1.8 KB) - added by mg 12 months ago.
datepicker3.png Download (13.4 KB) - added by mg 12 months ago.

Change History

Changed 12 months ago by mg

Changed 12 months ago by mg

Changed 12 months ago by mg

in reply to: ↑ description   Changed 11 months 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

  Changed 10 months ago by joern.zaefferer

  • milestone changed from TBD to 1.8

  Changed 9 months ago by kbwood

  • status changed from new to closed
  • resolution set to fixed

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.