I have two dates Sun Mar 08 2020 05:30:00 GMT+0530 (India Standard Time) Sat Mar 14 2020 05:30:00 GMT+0530 (India Standard Time) when I loop these two dates with condition I want to get the 7 days between the days. But it returns upto friday only.
Below I added my code snippetSomeone help me what went wrong.
getDaysArray = (start, end) => {
console.log(start,end)
for (var arr = [], dt = start; dt <= end; dt.setDate(dt.getDate() + 1)) {
console.log(dt);
arr.push(new Date(dt.setHours(23, 59, 59, 0)));
}
console.log("array=>"+arr)
return arr;
};