Closed
Bug 1723515
Opened 3 years ago
Closed 3 years ago
Incorrect date parsing when date contains hyphens
Categories
(Core :: JavaScript: Standard Library, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 1439800
People
(Reporter: jk.bhu85, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
21.18 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0
Steps to reproduce:
Open console in Firefox browser. Create a date object by passing the value '21-Aug-2021' as the parameter to the constructor. The code for this would be new Date('21-Aug-2021')
.
Actual results:
In the output, it can be observed that the year is coming as a negative number. The exact output of the code is 'Tue Aug 21 -2021 00:00:00 GMT+0553 (India Standard Time)'.
Expected results:
The year should be positive number because hyphen is a separator not minus sign. Chrome parses the specified format correctly.
Reporter | ||
Comment 1•3 years ago
|
||
This bug is a duplicate of https://bugzilla.mozilla.org/show_bug.cgi?id=1693692
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
Updated•1 year ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•