Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

197
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda