Skip to main content

Search and Top Navigation

#9419 closed bug (duplicate)

Opened July 10, 2013 04:43PM UTC

Closed July 11, 2013 02:03AM UTC

Last modified June 24, 2014 04:24PM UTC

With a 4 digit year or 2 digit month format, the altField value changes before you are done typing.

Reported by: worpet Owned by:
Priority: minor Milestone: none
Component: ui.datepicker Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:

Set the dateFormat to "mm/dd/yy".

Attempt to enter this date into the altField: "01/01/1999". As soon as you enter the the "1" for "1999", the field value and calendar will change to "01/01/2001". Next, with focus after the last character in the altField, try to backspace to fix it. As soon as you backspace to "01/01/20", the field value and calendar will change to "01/01/2020".

The problem seems to be due to in doKeyUp it will attempt to parse the input into a date and then change the value of the altField to that date. After entering characters up to "01/01/1", the "1" at the end seems to get parsed into "2001", despite that "yy" indicates a 4 digit date.

Here is a JSFiddle:

Attachments (0)
Change History (3)

Changed July 10, 2013 04:52PM UTC by worpet comment:1

It looks like the issue described in ticket #8353 could be the root cause of this.

Changed July 11, 2013 02:03AM UTC by tj.vantoll comment:2

resolution: → duplicate
status: newclosed

Duplicate of #8353.Hi worpet,

Thanks for taking the time to contribute to the jQuery UI project. I'm going to mark this one as a duplicate as #8353 is the cause of this.

should throw an error which would prevent the
from being updated.

If you are interested in looking into #8353 feel free to submit a patch via a pull request.


Changed June 24, 2014 04:24PM UTC by java4life comment:3

I saw this bug and this is clearly not duplicate of the bug #8353. Behavior is totally different. The bug #8353 is about field taking wrong date format. This bug is about field changing what you are typing.

Maybe you do not want to fix it right now but this is not a duplicate of the bug #8353.