New issue
Advanced search Search tips

Issue 757198 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Date parses invalid ISO8601 string

Reported by fairweat...@gmail.com, Aug 19 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36

Steps to reproduce the problem:
1. Open the console and execute
2. new Date('2012-11-31T23:59:59.000Z').toISOString();
3. 

What is the expected behavior?
RangeError: Invalid time value

What went wrong?
Displays: "2012-12-01T23:59:59.000Z"

Did this work before? No 

Chrome version: 60.0.3112.90  Channel: stable
OS Version: Fedora 23
Flash Version: 

ES5-shim is still shimming Date for this error.
https://github.com/es-shims/es5-shim/blob/master/es5-shim.js#L1411
 

Comment 1 by tkent@chromium.org, Aug 20 2017

Components: -Blink Blink>JavaScript
Labels: Needs-Triage-M60 M-62 OS-Mac OS-Windows
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on Mac 10.12.6, Win-10 and Ubuntu 14.04 using chrome reported version #60.0.3112.90 and latest canary #62.0.3192.2.

This is a non-regression issue as it is observed from M45 old builds. 

Hence, marking it as untriaged to get more inputs from dev team.

Thanks...!!
Components: -Blink>JavaScript Blink>JavaScript>Internationalization
Status: Available (was: Untriaged)
The specification here is pretty vague. See https://tc39.github.io/ecma262/#sec-date.parse . Dates which are not really valid are still permitted based on implementation-specific rules.

Here, ChakraCore seems to follow V8 in permitting this date, whereas SpiderMonkey and JSC reject the date.

I'd suggest waiting for a more specific Date spec before making any changes here.
Thanks for looking at the problem, it's a pity that in 2017, and with the ISO8601 specification, that there are still inconsistencies (implementation-specific rules) with `Date` across engines.
I agree that this is a pity! Unfortunately, the Date constructor is more than just an ISO 8601 date parser.
For me it makes `Date` many things, but not an ISO8601 parser, so parsing such strings remains something that must be performed prior to constructing a `Date` object. Again thanks, I can only hope that the "specification" tightens up on this in the future. 
Project Member

Comment 8 by sheriffbot@chromium.org, Aug 31

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)

Sign in to add a comment