Closed
Bug 1860425
Opened 2 years ago
Closed 2 years ago
Consider dropping support for numeric time zones without "GMT" prefix in Date.parse
Categories
(Core :: JavaScript: Standard Library, defect, P2)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
FIXED
121 Branch
| Tracking | Status | |
|---|---|---|
| firefox121 | --- | fixed |
People
(Reporter: vinny.diehl, Assigned: vinny.diehl)
References
(Blocks 1 open bug)
Details
(Keywords: parity-chrome, parity-safari)
Attachments
(1 file)
We currently support time zone formats such as "-04" as opposed to "GMT-04", which are rejected by both Chrome and Safari:
> eshost -te 'new Date("12-Mar-2022 -04")'
| Engine | Result |
|---|---|
| JavaScriptCore | Invalid Date |
| SpiderMonkey | Fri Mar 11 2022 21:00:00 GMT-0700 (Mountain Standard Time) |
| V8 | Invalid Date |
While these formats are reasonable to support, we might consider dropping support for webcompat purposes.
| Assignee | ||
Comment 1•2 years ago
|
||
Before I or someone else begins work on this, do you agree with this change, :arai?
Severity: -- → S3
Flags: needinfo?(arai.unmht)
Comment 2•2 years ago
|
||
Looks like this is specific to when the input has no "time" part.
If hh:mm part is provided, JavaScriptCore and V8 accept them.
Firefox accepts them except for +04 without space.
If there's only hh, no browser accepts.
| JavaScriptCore | SpiderMonkey | V8 | |
|---|---|---|---|
"12-Mar-2022 00:00:00-04" |
OK | OK | OK |
"12-Mar-2022 00:00:00 -04" |
OK | OK | OK |
"12-Mar-2022 00:00:00+04" |
OK | ERR | OK |
"12-Mar-2022 00:00:00 +04" |
OK | OK | OK |
"12-Mar-2022 00:00-04" |
OK | OK | OK |
"12-Mar-2022 00:00 -04" |
OK | OK | OK |
"12-Mar-2022 00:00+04" |
OK | ERR | OK |
"12-Mar-2022 00:00 +04" |
OK | OK | OK |
"12-Mar-2022 00-04" |
ERR | ERR | ERR |
"12-Mar-2022 00 -04" |
ERR | ERR | ERR |
"12-Mar-2022 00+04" |
ERR | ERR | ERR |
"12-Mar-2022 00 +04" |
ERR | ERR | ERR |
So, I agree with rejecting the "12-Mar-2022 -04" format, but it's better keep accepting when hh:mm are give.
and also optionally align with other browser for +04 without space.
Flags: needinfo?(arai.unmht)
| Assignee | ||
Comment 3•2 years ago
|
||
Updated•2 years ago
|
Assignee: nobody → vinny.diehl
Status: NEW → ASSIGNED
| Assignee | ||
Updated•2 years ago
|
Blocks: sm-date-parse
Updated•2 years ago
|
Attachment #9359753 -
Attachment description: Bug 1860425 - Adjust parsing for timezone numbers without "GMT" prefix r?arai → WIP: Bug 1860425 - Adjust parsing for timezone numbers without "GMT" prefix r?arai
Updated•2 years ago
|
Priority: -- → P2
Updated•2 years ago
|
Attachment #9359753 -
Attachment description: WIP: Bug 1860425 - Adjust parsing for timezone numbers without "GMT" prefix r?arai → Bug 1860425 - Adjust parsing for timezone numbers without "GMT" prefix r?arai
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/46326a19988d
Adjust parsing for timezone numbers without "GMT" prefix r=arai
Comment 5•2 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
status-firefox121:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•