Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

354
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!