Closed Bug 1760290 Opened 2 years ago Closed 8 months ago

Parse YYYY.mm.dd dates in Date constructor

Categories

(Core :: JavaScript: Standard Library, defect, P3)

Firefox 91
defect

Tracking

()

RESOLVED DUPLICATE of bug 449921

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

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.

Component: Untriaged → Widget: Cocoa
Product: Firefox → Core

Confirmed with https://jsfiddle.net/Lejv09bt/

Moving this to the JavaScript Engine component for further triage.

Status: UNCONFIRMED → NEW
Component: Widget: Cocoa → JavaScript Engine
Ever confirmed: true

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.

Blocks: 1274354
Severity: -- → S4
Priority: -- → P3

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.

Keywords: parity-chrome
Component: JavaScript Engine → JavaScript: Standard Library

The component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit auto_nag documentation.

Priority: P3 → --
Webcompat Priority: --- → P3
Webcompat Priority: P3 → ---
Priority: -- → P3

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: nobody → vinny.diehl
Status: NEW → ASSIGNED
See Also: → 449921

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.

See Also: → 1852422

Closing this as the aforementioned patch is about to land.

Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Duplicate of bug: 449921
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.