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

96
Views
Change week day index in time

I want to set week day index (not month day) in time

for example:

"2021-11-01T10:50:02+04:00" should be converted to "2021-11-08T10:50:02+04:00"

"2021-11-02T10:50:02+04:00" should be converted to "2021-11-08T10:50:02+04:00"

and so on

basically my task is to convert any week day to friday

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

0

So update myDate to Friday (in current week), you could do something like this:

var dayToSet = 5; // Friday
var currentDay = myDate.getDay();
var distance = dayToSet - currentDay;
myDate.setDate(myDate.getDate() + distance);
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!