Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

202
Visualizações
DateTime Internationalization not working for Norwegian (Nynorsk) locale

When trying to display the datetime value in Norwegian (Nynorsk) locale, using the javascript internationalization api, I get unexpected results.

I'm using the ISO 639 code for Norwegian (Nynorsk) locale, which is nn, but that does not work as expected.

Sample javascript code to print datetime value in the browser console (Google Chrome, language: English)

console.log(
  new Date().toLocaleDateString('nn', { dateStyle: 'full' })
)  
// output: 'Monday, May 9, 2022'
// expected output: 'mandag 9. mai 2022'

Any ideas where I'm going wrong?

Am I using the correct locale code? I've tried nn-NO as well, but same results. The locale codes no and nb work, but I can't use them since I guess they map to the Norwegian (Bokmål) locale.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can for now use nb - the bokmål date is understood by all Norwegian

the nn(-NO) is a valid locale - it seems to be a Chrome bug

the code below works in Edge browser but not in Chrome 100

console.log(
  new Date().toLocaleDateString('nb', { dateStyle: 'full' })
)  
// expected and actual output: 'mandag 9. mai 2022'


console.log(
  new Date().toLocaleDateString('nn', { dateStyle: 'full' })
)  
// actual output in Chrome: 'Monday 9. May 2022'
// actual output in Edge: måndag 9. mai 2022

// testing this 
console.log(
  Intl.NumberFormat.supportedLocalesOf(["no", "no-NO", "nb", "nb-NO", "nn", "nn-NO"])
)
// I get [ "no", "no-NO", "nb", "nb-NO" ] in Chrome 100
// and   [ "no", "no-NO", "nb", "nb-NO", "nn", "nn-NO" ] in Edge

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda