Skip to main content

Search and Top Navigation

#7098 open bug ()

Opened March 10, 2011 07:42PM UTC

Last modified November 26, 2013 04:18PM UTC

Datepicker: Broken handling of four digit years before year 100

Reported by: Lexiyntax Owned by:
Priority: minor Milestone: none
Component: ui.datepicker Version: 1.8.10
Keywords: Cc:
Blocked by: Blocking:
Description

When entering an early four-digit year, i.e. 03/04/11, it will be translated to 03/04/2011 in the year browser. This is incorrect; a four digit year of 03/04/11 must be 03/04/0011 in the four digit year format and shown as such. Additionally, trying to manually correct it using 03/04/0011 still shows the wrong date picker, for 2011 instead of 0011.

This bug makes it impossible to correctly browse and enter early dates for historical data entry and processing.

Attachments (0)
Change History (8)

Changed May 04, 2011 06:11PM UTC by kzys comment:1

Because Datapicker has

shortYearCutoff
and default value is
+10
. If you want to use Datapicker on historical data application, please try
shortYearCutoff: 0
.

http://jqueryui.com/demos/datepicker/#option-shortYearCutoff

Changed May 13, 2011 09:47AM UTC by bombo comment:2

Setting

shortYearCutoff
to
0
does not seem to do the trick. In fact it seems to result in some strange behavior in terms of emulating
shortYearCutoff: 21
or something like that.

Here is a jsfiddle sample, reproducing said behavior:

http://jsfiddle.net/bombo/47f7D/24/

Even when inputting

01/01/0001
, the datepicker seems to store
01/01/2001
internally, as can be seen when doing so and pressing ''Show date''.

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

milestone: 1.9.01.11.0

Changed October 19, 2012 04:50PM UTC by mikesherov comment:4

status: newopen

confirmed on latest: http://jsfiddle.net/LgVqM/7/

Changed August 07, 2013 09:26PM UTC by tj.vantoll comment:5

#9488 is a duplicate of this ticket.

Changed August 07, 2013 09:27PM UTC by tj.vantoll comment:6

milestone: 1.11.0none
summary: Broken handling of four digit years before year 100Datepicker: Broken handling of four digit years before year 100

Test case from brunobg in #9488: http://jsfiddle.net/NYNCh/.

Changed October 14, 2013 12:17PM UTC by tj.vantoll comment:7

#9600 is a duplicate of this ticket.

Changed November 26, 2013 04:18PM UTC by brunobg comment:8

Sent a pull request with the fix: https://github.com/jquery/jquery-ui/pull/1142