moment / luxon

⏱ A library for working with dates and times in JS
https://moment.github.io/luxon
MIT License
15.4k stars 729 forks source link

Missing Locale: 'af' #1396

Closed fwiwDev closed 1 year ago

fwiwDev commented 1 year ago

This is related to issue 1111

I noticed that when I do as the prior user mentioned, I get the same off result and now this locale for Afrikaans is now supported in the Chrome browser but not in Luxon.

new Intl.DateTimeFormat("af").resolvedOptions

Returns 'af' in Chrome

new Intl.DateTimeFormat("af-ZA").resolvedOptions

Returns 'af-ZA' in Chrome

const dateOutputFr = DateTime.fromFormat('18/07/2021', 'dd/MM/yyyy', { locale: 'fr' });
console.log(dateOutputFr.toLocaleString(DateTime.DATE_MED_WITH_WEEKDAY));

Returns: dim. 18 juil. 2021

const dateOutputAf = DateTime.fromFormat('18/07/2021', 'dd/MM/yyyy', { locale: 'af' });
console.log(dateOutputAf.toLocaleString(DateTime.DATE_MED_WITH_WEEKDAY));

Returns: Sun, Jul 18, 2021

const dateOutputAfZa = DateTime.fromFormat('18/07/2021', 'dd/MM/yyyy', { locale: 'af-ZA' });
console.log(dateOutputAfZa.toLocaleString(DateTime.DATE_MED_WITH_WEEKDAY));

Returns: Sun, Jul 18, 2021

Running luxon version 2.02

diesieben07 commented 1 year ago

I cannot reproduce this with Luxon 2.0.2 (or 3.3.0) in Chrome 111 or Firefox 111. I get So. 18 Jul. 2021 for your code. With DATE_FULL I get 18 Julie 2021.

Can you please provide more details?

fwiwDev commented 1 year ago

Thank you. My version of Chromium was out of date. I updated it and it is now working just fine.