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

136
Views
Cómo obtener las fechas en una matriz desde hoy hasta los próximos 15 días y es necesario excluir el sábado y el domingo

Cómo obtener las fechas en una matriz desde hoy hasta los próximos 15 días y es necesario excluir los sábados y domingos. Ej: hoy es 4/5/22 y necesito 15 días en una matriz,

como ['4/5/22', '5/5/22', '6/5/22'.....'19/5/22'].

Encontré algunos enlaces, pero aquí estoy obteniendo una fecha futura. ¿Podría ayudarme a obtener todas las fechas en una matriz?

 var dt = new Date(); dt.setDate(dt.getDate() + 3);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

 var loop_ = 15; var start = Date.now(); var response = [start]; while(loop_> 0){ var nextD = response[response.length-1]+86400000; const nextD_ = new Date(nextD); if(nextD_.getDay() !== 7 && nextD_.getDay() !== 1){response.push(nextD); loop_ = loop_-1} } console.log(response)

El domingo es igual a 1 y el sábado a 7 (calendario inglés)

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!