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

Incorrect format for 'nb-NO' locale #342

@sonatu

Description

@sonatu

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions