New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 624127 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Chrome's Date() constructor has interprets invalid dates as invalid, except when it doesn't

Reported by r...@whoamedia.com, Jun 28 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0

Steps to reproduce the problem:
1. new Date('2016/06/35');
2. new Date(2016,5,35);
3. Compare the differences in output

What is the expected behavior?
I expect them both to produce the same results. 

What went wrong?
I'm guessing when Date() has a string passed to it, it does different validation. However, the validation is itself invalid.

Did this work before? No 

Chrome version: 51.0.2704.103  Channel: n/a
OS Version: OS X 10.11
Flash Version: Shockwave Flash 22.0 r0

The first example works in Safari, Firefox and IE/Edge.
 
Components: -Blink Blink>JavaScript
Status: Untriaged (was: Unconfirmed)
Cc: u...@chromium.org littledan@chromium.org
Components: -Blink>JavaScript Blink>JavaScript>Internationalization
Status: Available (was: Untriaged)
Cc: -littledan@chromium.org js...@chromium.org yangguo@chromium.org
Owner: littledan@chromium.org
Status: Assigned (was: Available)
The JS specification leaves it undefined what happens in the Date constructor if the date is not ISO 8601. Any relaxation in date parsing should be based on new spec work which tries to standardize legacy behavior across multiple browsers at https://bugzilla.mozilla.org/show_bug.cgi?id=1274354

Sign in to add a comment