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.
,
Jul 5 2016
,
Jul 6 2016
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 |
|||
Comment 1 by timloh@chromium.org
, Jul 5 2016Status: Untriaged (was: Unconfirmed)