Opened 12 years ago
Last modified 9 years ago
#7098 open bug
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.
Change History (8)
comment:1 follow-up: 2 Changed 12 years ago by
comment:2 Changed 12 years ago by
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.
comment:3 Changed 10 years ago by
Milestone: | 1.9.0 → 1.11.0 |
---|
comment:4 Changed 10 years ago by
Status: | new → open |
---|
confirmed on latest: http://jsfiddle.net/LgVqM/7/
comment:6 Changed 10 years ago by
Milestone: | 1.11.0 → none |
---|---|
Summary: | Broken handling of four digit years before year 100 → Datepicker: Broken handling of four digit years before year 100 |
Test case from brunobg in #9488: http://jsfiddle.net/NYNCh/.
comment:8 Changed 9 years ago by
Sent a pull request with the fix: https://github.com/jquery/jquery-ui/pull/1142
Because Datapicker has
shortYearCutoff
and default value is+10
. If you want to use Datapicker on historical data application, please tryshortYearCutoff: 0
.http://jqueryui.com/demos/datepicker/#option-shortYearCutoff