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

149
Views
How to increase the day in this date string '2022-05-06' in JS

How to increase the day in this date string '2022-05-06' in JS? It can be both native and moments solution. I checked add method in moment but looks like I am doing something wrong and it doesn't work:

const date = '2022-05-06'
console.log(moment(date).add(1, 'days'))
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.3/moment.min.js"></script>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You should parse string to moment object properly:

const date = '2022-05-06'
const newDate = moment(date,'YYYY-MM-DD').add(1, 'days');
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!