Closed Bug 1724112 Opened 3 years ago Closed 3 years ago

Incorrect date format for Haiti

Categories

(Core :: JavaScript: Internationalization API, defect)

Firefox 90
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: brandonesbox, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0

Steps to reproduce:

In the browser console, run

(new Intl.DateTimeFormat("ht")).format(new Date("2021-08-04"))

Actual results:

"8/3/2021"

Expected results:

"3/8/2021"

Oops, I'm just realizing that Firefox might not have any internationalization support for Haiti. Using the i18n scheme for French would be a huge improvement.

(new Intl.DateTimeFormat("ht", { dateStyle: "full" })).format(new Date("2020-03-01"))
-> "Saturday, February 29, 2020"

The Bugbug bot thinks this bug should belong to the 'Core::JavaScript: Internationalization API' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → JavaScript: Internationalization API
Product: Firefox → Core

That's because ht is not the right BCP47 language identifier for Haiti. It's fr-HT:

(new Intl.DateTimeFormat("fr-HT")).format(new Date("2021-08-04"))
"03/08/2021"

You can verify that by checking (new Intl.DateTimeFormat("fr-HT")).resolvedOptions().locale

and the list of locales here: https://github.com/unicode-org/cldr-json/tree/master/cldr-json/cldr-dates-modern/main

Closing as INVALID per comment #3.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID

ht is the language identifier for Hatian Creole, the other official language of Haiti. https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/language_territory_information.html

I suppose I should take it up with CLDR, since they seem not to have published to https://github.com/unicode-org/cldr-json/tree/master/cldr-json/cldr-dates-modern/main yet?

yes! And for many use cases you can also suggest they add fallback from ht to fr-HT to improve on the current ht -> en-GB fallback :)

Great, thank you!

You need to log in before you can comment on or make changes to this bug.