Date parse with a localized formatted date returns NaN
Categories
(Core :: JavaScript: Standard Library, defect, P3)
Tracking
()
People
(Reporter: xavophonic, Unassigned, NeedInfo)
References
(Blocks 1 open bug)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0
Steps to reproduce:
- Open Firefox 92 French version
- Open the debug console.
- Run the command : Date.parse("Mercredi 8 Septembre 2021")
Actual results:
Result : NaN
Expected results:
It should return a number containing the corresponding the millisecond number since 1th of January 1970, 00:00:00.000 GMT.
This is currently the number return by Chrome and Edge.
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::JavaScript Engine' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 2•3 years ago
|
||
So, unfortunately Date.parse
, unless you are parsing something of the Date Time String Format, is implementation defined. As a result, I'm going to mark this as S3.
Updated•3 years ago
|
Comment 3•1 year ago
|
||
so i made a shopify integrated POS (https://ismartsync.com) in mern stack and deployed it online using microsoft Azure it is working fine in chrome and edge but when the client (https://chiefapparel.pk) opens in on firefox and makes some order or tries to export daily reports it gives date and time error even tho everything is configured properly but during console log it showed that firefox is parsing the date and time in a different format than whats configured in browser and software code
Comment 4•1 year ago
|
||
Can you provide examples of the exact Date formats that are failing?
Comment 5•1 year ago
|
||
Confirmed parity bug on 121.
> eshost -te 'new Date("8 Septembre 2021")'
Engine | Result |
---|---|
JavaScriptCore | Wed Sep 08 2021 00:00:00 GMT-0700 (Mountain Standard Time) |
SpiderMonkey | Invalid Date |
V8 | Wed Sep 08 2021 00:00:00 GMT-0700 (Mountain Standard Time) |
Comment 6•1 year ago
|
||
As discovered in bug 1617562, the example "8 Septembre 2021"
works on Chrome and Safari simply because you've tested it at September,
where the first 3 characters "Sep" are same between English and French.
If it was April ("8 Avril 2021"
), it doesn't work on any of them, because the first 3 characters are "Avr" vs "Apr"
Comment 7•1 year ago
|
||
Thanks for doing more testing on this arai. Since it turns out no other engines support internationalized dates, should we make this bug about supporting the first 3 letters of the date, or should we WONTFIX this and do that on a separate bug?
Comment 8•1 year ago
|
||
it would be better filing a new bug, to avoid confusion.
Comment 9•1 year ago
|
||
Sure thing, here it is: bug 1862910
:wajahatelahi2011, when you get a chance, feel free to comment with more info as to the exact Date formats that are giving you problems, they are likely an issue unrelated to this i18n bug (given the site works on other browsers), but I can help you open a new bug for it.
Description
•