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: |
Description
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 comment:1
Changed July 11, 2013 02:03AM UTC by comment:2
resolution: | → duplicate |
---|---|
status: | new → closed |
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.
parseDateshould throw an error which would prevent the
altFieldfrom being updated.
If you are interested in looking into #8353 feel free to submit a patch via a pull request.
Thanks.
It looks like the issue described in ticket #8353 could be the root cause of this.