#8353 closed bug (fixed)
Datepicker: parseDate accepts dates with two year digits with format 'mm/dd/yy' which should require four year digits
Reported by: | andrewwhitaker | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.11.1 |
Component: | ui.datepicker | Version: | 1.8.20 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
var d = "12/12/12"; var parsed = $.datepicker.parseDate("mm/dd/yy", d); // yields 12/12/2012, should not succeed.
Example: http://jsfiddle.net/WWJfn/
An exception should be thrown here instead of the date being parsed successfully.
Change History (13)
comment:1 Changed 10 years ago by
Milestone: | 1.9.0 → 1.11.0 |
---|
comment:2 Changed 10 years ago by
Priority: | minor → undetermined |
---|---|
Status: | new → open |
comment:3 Changed 10 years ago by
comment:4 Changed 10 years ago by
Priority: | undetermined → minor |
---|
comment:5 Changed 10 years ago by
Summary: | parseDate accepts dates with two year digits with format 'mm/dd/yy' which should require four year digits. → Datepicker: parseDate accepts dates with two year digits with format 'mm/dd/yy' which should require four year digits |
---|
Still an issue as of 1.9.2 - http://jsfiddle.net/tj_vantoll/en69t/.
comment:6 follow-up: 9 Changed 10 years ago by
Any chance of getting this fixed sooner than later please? We're using this in a date range control and the user input is getting messed up because we depend on parseDate to return a valid value only when the format matches the input.
If there's a workaround, it would be greatly appreicated. Thank you.
comment:7 Changed 10 years ago by
@PRISMAY If it's a blocker for you, then it seems it would be beneficial for you to dig in, track down the bug, figure out a fix, and submit a pull request.
comment:9 Changed 10 years ago by
Replying to PRISMAY:
Any chance of getting this fixed sooner than later please? We're using this in a date range control and the user input is getting messed up because we depend on parseDate to return a valid value only when the format matches the input.
If there's a workaround, it would be greatly appreicated. Thank you.
Hi, i had a problem like yours and using something like this http://jsfiddle.net/FDAkp/ inside the jquery ui js solved my problem.
Excuse me if i'm doing it the wrong way and drop it.
comment:10 Changed 9 years ago by
Submitted a pull request for this bug: https://github.com/jquery/jquery-ui/pull/1248
comment:11 Changed 9 years ago by
Milestone: | 1.11.0 → none |
---|
comment:12 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
Datepicker: reject dates with two year digits when expecting 'yy'
Fixes #8353 Closes gh-1248
Changeset: 573037423822fa04a1888e3bcc52243b9324c5e2
comment:13 Changed 9 years ago by
Milestone: | none → 1.11.1 |
---|
http://jsfiddle.net/8PYY8/