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

350
Vistas
How to format date with Day.js in Vue.js

I am building a web project with mainly Vue.js and am having problems with date time formatting. When getting data from my database (which is in datetime format), I get something like '2021-01-08T00:00:00'. Now is there a way to make Day.js accept such an input and convert that to either 'dd-mm-yyyy' or 'mm-dd-yyyy' or whatever format I want? I have tried:

this.data.DateOfBirth = dayjs(e.dateOfBirth).format("dd-mm-yyyy");

But it doesn't seem to work and throws an error warning like this on the browser console:

The specified value "Su-01-yyyy" does not conform to the required format, "yyyy-MM-dd".

Many thanks!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

format of the date is not correct.

  • dd -> day
  • mm -> minutes
  • DD -> Date
  • MM -> Month
  • YYYY -> Year

There are other formats as well. Please check the required format on the docs and use as per the requirement.

https://day.js.org/docs/en/display/format

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