Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Incorrect format for 'nb-NO' locale #342

Open
sonatu opened this issue Aug 14, 2020 · 0 comments
Open

Incorrect format for 'nb-NO' locale #342

sonatu opened this issue Aug 14, 2020 · 0 comments

Comments

@sonatu
Copy link

sonatu commented Aug 14, 2020

Currently at least short date format is incorrect for 'nb-NO' locale. Should be 'dd.MM.y', but it is 'd.M.y' instead.

Can be tested in runkit by running the following code snippet:

var intl = require("intl")
console.log(intl.DateTimeFormat('nb-NO').format(new Date(2020, 0, 1)))

"1.1.2020"

Actually the same problem now can be also reproduced in Chrome's (84.0.4147.125) and Edge's (84.0.522.59) Intl, just run the following in their Console:

console.log(window.Intl.DateTimeFormat('nb-NO').format(new Date(2020, 0, 1)))

"1.1.2020"

The only date library I know that gives correct format for 'nb-NO' is Moment (2.27.0), you can try in runkit:

var moment = require("moment")
moment.locale('nb-NO');
console.log(moment('2020/1/1').format('L'));

"01.01.2020"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant