#10746 closed bug (notabug)
Datepicker mm/dd/y format doesn't support years before 1929
Reported by: | jvic | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.datepicker | Version: | 1.11.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Datepicker with format, where is not complete year part (e.g. "mm/dd/y") doesn't support years before 1929.
Steps to reproduce: 1) Select some date before 1929
See demo: http://jsfiddle.net/Lhk94t8z/7/ Browser: Chrome
Change History (8)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
Correct 1926, because today we are in 2015 and the shortYearCutoff
defaults to "+10"
(see the documentation). I'm not sure how you expected this to work since it's completely ambiguous.
comment:3 Changed 8 years ago by
You are wrong.
Check this updated jsfiddle: http://jsfiddle.net/Lhk94t8z/8/ If I call setDate() with Date object (year 1912) and after that I call getDate() datepicker must return same value.
comment:4 Changed 8 years ago by
That's impossible since the canonical source is lossy, as specified by you via the date format.
comment:5 Changed 8 years ago by
Hi,
1) It's possible. Datepicker has internally stored date object. There is no loss, when user don't edit input manually. I prepared nasty fix: http://jsfiddle.net/Lhk94t8z/9/
2) If it's not bug, please explain why following UC in this jsfiddle (http://jsfiddle.net/Lhk94t8z/8/) returns 1912.
- setDate (1912)
- getDate (2012)
- setDate (1912)
- getDate (1912)
comment:8 Changed 8 years ago by
If you want to. Considering this is tied to lossy date formats, I'm not sure it will be fixed before the rewrite is done, unless someone sends a PR.
Year 1928 is ok. Problem is from year 1926.