Parse YYYY.mm.dd dates in Date constructor
Categories
(Core :: JavaScript: Standard Library, defect, P3)
Tracking
()
People
(Reporter: firefboxer, Assigned: vinny.diehl)
References
(Blocks 1 open bug)
Details
(Keywords: parity-chrome)
Steps to reproduce:
The Firefox counts YYYY.mm.dd (for example, "2022.03.18") dates invalid (It shows the warning: "Invalid Date value").
Chromium based browsers parse such dates:
- "2022.03.18"
- "2022.03.18 12:00:00Z"
correctly.
new Date("2022.03.18 12:00:00Z")
Actual results:
"Invalid Date value"
Expected results:
Fri Mar 18 2022 12:00:00 GMT+0000
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Widget: Cocoa' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•2 years ago
|
||
Confirmed with https://jsfiddle.net/Lejv09bt/
Moving this to the JavaScript Engine component for further triage.
Comment 3•2 years ago
|
||
Apparently the date format yyyy.mm.dd
is used in Hungary and in Kazakhstan based on Wikipedia.
While ECMAScript does not define any valid date format, it sounds reasonable to accept these inputs.
However, it might also cause ambiguous inputs when comparing yy.mm.dd
versus dd.mm.yy
.
Comment 4•2 years ago
|
||
For comparison, new Date("2022.03.18")
and new Date("2022.03.18 12:00:00Z")
return the string "Invalid Date" in Safari 15.3 on macOS 11.6.4.
Updated•2 years ago
|
Comment 5•2 years ago
|
||
The component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit auto_nag documentation.
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 6•8 months ago
|
||
My patch for Bug 449921 will allow and test for YYYY.MM.DD
.
Currently we do not accept "Z" (zulu time i.e. GMT) as a time zone for any date format. IMO this should be filed as its own parity bug.
Assignee | ||
Comment 7•8 months ago
•
|
||
I have opened Bug 1852422 regarding zulu time. :Akoki, you may add yourself to the CC list for that bug if you are interested in following its progress.
Assignee | ||
Comment 8•8 months ago
|
||
Closing this as the aforementioned patch is about to land.
Description
•