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

110
Views
Function to add more days to a date

I don't know much about the new Date() function and I wanted a way to add days to a date. I have

        this.formGeral.patchValue({data:new Date().toISOString().substring(0, 10)});

I would like to add 5 more working days to this date (I could not count on Saturday or Sunday) how could i change this patchvalue ?

I saw that there would be this example, but here it returns the working days too https://pt.stackoverflow.com/questions/9281/fun%c3%a7%c3%a3o-para-adicionar-mais-horas-ou-dias-a-uma-data

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Here is the code

const dt = new Date();
dt.setDate(dt.getDate() + 5); // adding 5 more days
this.formGeral.patchValue({data:dt});

You can use momentjs also https://momentjs.com/

Example- moment().add(1, 'days'); //adds 1 day to the current date

about 4 years ago · Santiago Trujillo 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!