Closed Bug 1872333 Opened 5 months ago Closed 5 months ago

Day of month overflow should be parsed as an ISO style date

Categories

(Core :: JavaScript: Standard Library, defect)

defect

Tracking

()

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: vinny.diehl, Assigned: vinny.diehl)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, parity-chrome)

Attachments

(1 file)

When day of month overflows the number of days in that actual month, we simply skip to the next month. For example, Feb 31 on a non-leap year becomes Mar 3. An overflowed date like this doesn't violate the Date Time String Format, which simply calls for a number 01-31 for DD, however, we don't parse these overflows as a spec date, which Chrome does:

Input JavaScriptCore SpiderMonkey V8
"2009-02-31" Invalid Date Tue Mar 03 2009 00:00:00 GMT-0700 (Mountain Standard Time) Mon Mar 02 2009 17:00:00 GMT-0700 (Mountain Standard Time)
"2009-02-31T00:00" Invalid Date Invalid Date Tue Mar 03 2009 00:00:00 GMT-0700 (Mountain Standard Time)

The spec doesn't say what to do when DD overflows, so I don't believe we are in violation, however this discrepancy is preventing us from being able to use ParseISOStyleDate to accurately detect whether a string follows the spec format over in bug 1872116.

Depends on D197046

Assignee: nobody → vinny.diehl
Status: NEW → ASSIGNED
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/a0496a30342e
Parse mday overflow as ISO style date r=arai
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
Keywords: dev-doc-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: