#9419 closed bug (duplicate)
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: http://jsfiddle.net/NKL5h/9/
Change History (3)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
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. parseDate
should throw an error which would prevent the altField
from 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.