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

355
Visualizações
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 Respostas
Responde à pergunta

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 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