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

182
Vistas
xlsx package: Array of object to json -date field value is trimmed for some rows

I am facing a weird issue in xlsx while converting an array of objects to an excel

Input array

const  input=[{id:1,DOb:'02/23/1984'},{id:2,DOb:'02/23/1985'},{id:3,DOb:'02/23/1985'},{id:4,DOb:'02/23/1940'}] 

In the output excel file, the DOB value is trimmed for some rows,

The above example returns the DOB value in excel is 02/23/40 for the input 02/23/1940.

As you see the year 1940 is trimmed to 40 What I need to exact version of the input ie 1940.

Here is the code

    const workSheet = XLSX.utils.json_to_sheet(input)
    const wb = XLSX.utils.book_new()

    XLSX.utils.book_append_sheet(wb, workSheet, 'Sheet1')
    XLSX.writeFile(wb, path)
about 4 years ago · Juan Pablo Isaza
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