Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

toLocaleDateString() - issue with Norwegian

I have an issue with getting locale datestring correctly formatted. It suddenly stopped working for Norwegian. I've tried 'no-NO' and 'nb-NO'. Any ideas about what could be causing this? I'm stuck.

Example:

console.log(new Date().toLocaleDateString('no-NO', {month: 'long', day: 'numeric', year: 'numeric'}))
// 2021 M08 10

Other languages work as expected:

console.log(new Date().toLocaleDateString('da-DK', {month: 'long', day: 'numeric', year: 'numeric'}))
// 10. august 2021
like image 978
Erik Erik Avatar asked Sep 11 '25 01:09

Erik Erik


1 Answers

There is a bug in chrome causing this, hopefully they will fix it soon. https://bugs.chromium.org/p/chromium/issues/detail?id=1215606

like image 66
Michael Avatar answered Sep 12 '25 13:09

Michael