Skip to main content

Search and Top Navigation

#10746 closed bug (notabug)

Opened January 09, 2015 11:38AM UTC

Closed January 09, 2015 02:03PM UTC

Last modified January 13, 2015 12:39PM UTC

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

Attachments (0)
Change History (8)

Changed January 09, 2015 12:09PM UTC by jvic comment:1

Year 1928 is ok. Problem is from year 1926.

Changed January 09, 2015 02:03PM UTC by scottgonzalez comment:2

resolution: → notabug
status: newclosed

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.

Changed January 09, 2015 06:04PM UTC by jvic comment:3

_comment0: You aren't right. \ \ 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. \ 1420826743640137

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.

Changed January 09, 2015 06:13PM UTC by scottgonzalez comment:4

That's impossible since the canonical source is lossy, as specified by you via the date format.

Changed January 12, 2015 06:17AM UTC by jvic comment:5

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)

Changed January 12, 2015 02:51PM UTC by scottgonzalez comment:6

#2 sounds like a bug.

Changed January 13, 2015 07:22AM UTC by jvic comment:7

Should I open new ticket with #2?

Changed January 13, 2015 12:39PM UTC by scottgonzalez comment:8

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.