Closed Bug 1730155 Opened 3 years ago Closed 6 months ago

Date parse with a localized formatted date returns NaN

Categories

(Core :: JavaScript: Standard Library, defect, P3)

Firefox 92
defect

Tracking

()

RESOLVED WONTFIX

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:

  1. Open Firefox 92 French version
  2. Open the debug console.
  3. 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.

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.

Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Blocks: 1274354

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.

Severity: -- → S3
Priority: -- → P3
Component: JavaScript Engine → JavaScript: Standard Library

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

Can you provide examples of the exact Date formats that are failing?

Flags: needinfo?(wajahatelahi2011)

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)
Status: UNCONFIRMED → NEW
Ever confirmed: true

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"

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?

Flags: needinfo?(arai.unmht)

it would be better filing a new bug, to avoid confusion.

Flags: needinfo?(arai.unmht)

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.

Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → WONTFIX
See Also: → 1862910
You need to log in before you can comment on or make changes to this bug.