Closed
Bug 1175778
Opened 9 years ago
Closed 9 months ago
Date.parse chokes on a period after abbreviated month
Categories
(Core :: JavaScript: Standard Library, enhancement)
Tracking
()
RESOLVED
FIXED
118 Branch
Tracking | Status | |
---|---|---|
firefox118 | --- | fixed |
People
(Reporter: jgbishop, Assigned: vinny.diehl)
References
(Blocks 1 open bug)
Details
(Keywords: parity-chrome, parity-ie)
Attachments
(1 file)
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0 Build ID: 20150525141253 Steps to reproduce: The Date.parse() routine can't handle a period after an abbreviated name, which occurs in the Associated Press style date format (e.g. "Aug.", "Sept.", "Oct.", etc). I found this while debugging a Django application (Django uses AP format by default for date fields). Chrome and IE 11 both handle the periods just fine. Actual results: Date.parse('Aug. 15, 2015') // Results in NaN Expected results: A valid value should be returned.
Updated•9 years ago
|
Severity: normal → enhancement
Whiteboard: [parity-chrome][parity-IE]
Updated•9 years ago
|
Component: General → JavaScript Engine
Product: Firefox → Core
Comment 1•9 years ago
|
||
Lovely. The spec says: The function first attempts to parse the format of the String according to the rules (including extended years) called out in Date Time String Format (20.3.1.16). If the String does not conform to that format the function may fall back to any implementation-specific heuristics or implementation-specific date formats. Unrecognizable Strings or dates containing illegal element values in the format String shall cause Date.parse to return NaN. So per spec our behavior is totally fine. Gotta love not-so-useful specs. :(
Updated•8 years ago
|
Component: JavaScript Engine → JavaScript: Standard Library
Comment 2•6 years ago
|
||
Mass bug change to replace various 'parity' whiteboard flags with the new canonical keywords. (See bug 1443764 comment 13.)
Keywords: parity-chrome,
parity-ie
Whiteboard: [parity-chrome][parity-IE]
Updated•2 years ago
|
Severity: normal → S3
Assignee | ||
Comment 3•9 months ago
|
||
This is fixed trivially by ignoring '.'
at the top level of the parse loop, as we do with commas and spaces. I have a patch incoming. :)
Assignee | ||
Comment 4•9 months ago
|
||
Updated•9 months ago
|
Assignee: nobody → vinny.diehl
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Updated•9 months ago
|
Attachment #9345541 -
Attachment description: Bug 1175778 - Allow '.' in `Date.parse` r?#spidermonkey-reviewers → Bug 1175778 - Allow '.' in `Date.parse` r?arai
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/331879c52f18 Allow '.' in `Date.parse` r=arai
Comment 6•9 months ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
status-firefox118:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•