Closed Venators closed 1 year ago
This still looks like a browser problem:
My regional format in Windows is English (Sweden) - en-SE
.
Firefox correctly gives it for new Intl.DateTimeFormat().resolvedOptions().locale
, but Chrome does en-US
.
Try to reproduce this in firefox.
Additionally, found this: https://bugs.chromium.org/p/chromium/issues/detail?id=1256694
Hi @MonstraG 👋🏻 Thank you for your reply. I checked the code in Firefox as suggested (checked Edge as well) and can confirm that they both behaved correctly. So this does look to be a Chrome bug!
Describe the bug I'm using Luxon in an Angular project (v13), and Luxon is returning an incorrect locale from Intl.DateTimeFormat().resolvedOptions().locale/DateTime.local().locale, but not for all timezones. The same behaviour was also present when the project was on Angular v12. If I console log the values from Luxon, I get the following:
If I use Chrome's Sensors => location => override, using Berlin and Tokyo as examples, Luxon returns the correct values:
I've seen comments on other threads suggesting that Luxon is behaving correctly and that the incorrect values come from the browser/OS language configurations, but I've checked both of those sources and believe them to be correct:
Chrome Language Settings
Windows Language Settings
![image](https://github.com/moment/luxon/assets/20661886/dc13788e-9aca-4cec-b081-c65b256850e2)
To Reproduce Using Luxon 3.3.0, run the following JS:
Actual vs Expected behaviour I expect to get en-NZ from
DateTime.local().locale
but actually get en-GB fromDateTime.local().locale
.System Configuration