Below logic works for excluding saturday and sunday, remaining dates are pushing to the aray. Now I'm trying to add some extra day, here also I need to exclude saturday and sunday, but its includes saturday and sunday as well...Is there any suggestion to excludes weekends for extra day values. Here is the sample code,
const extraday:number=3;
for (let i = 1 + extraday; i <= 15 + extraday; i++) {
const dt = new Date();
dt.setDate(dt.getDate() + i);
if (dt.getDay() !== 6 && dt.getDay() !== 0) {// excluding weekends
Array.push(); //
}
}