Closed
Bug 1275498
Opened 8 years ago
Closed 7 months ago
Date.parse('1-1-2012') returns NaN in Firefox but 1325404800000 in Chrome, Edge, and IE11
Categories
(Core :: JavaScript: Standard Library, defect)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
DUPLICATE
of bug 1557650
People
(Reporter: cpeterson, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: parity-chrome, parity-edge, parity-ie)
http://dygraphs.com/date-formats.html reports a number of Date.parse() problems, but the Firefox problems mostly stem from the parsing of dates with dash delimiters: GOOD: Date.parse('1/1/2012') returns 1325404800000 Chrome, Edge, IE11, Firefox, and Safari. BAD: Date.parse('1-1-2012') returns 1325404800000 in Chrome, Edge, and IE11 but NaN in Firefox and Safari.
Updated•7 years ago
|
Component: JavaScript Engine → JavaScript: Standard Library
Comment 2•7 years ago
|
||
I've been lurking around some of theses Date.parse bugs/feature requests and decided to start working on them. As far as I can see we previously supported the '1-1-2012' format (there is even commented out code for this) but seems to have decided to support dates with the format 'Wed Nov 05 21:49:11 GMT-0800 1997', where the tz offset comes before the year, instead. A very simple solution is to just remove the out-commented check on line 1020 at the expense of the format where the year comes last. I'm looking into how much work it is to get support for both formats.
Updated•7 years ago
|
Assignee: nobody → eric
Comment 3•6 years ago
|
||
Mass bug change to replace various 'parity' whiteboard flags with the new canonical keywords. (See bug 1443764 comment 13.)
Whiteboard: [parity-chrome][parity-edge][parity-ie]
Updated•3 years ago
|
Assignee: eric → nobody
Updated•2 years ago
|
Severity: normal → S3
Comment 4•7 months ago
|
||
I'm adding support for this in bug 1557650. :)
You need to log in
before you can comment on or make changes to this bug.
Description
•