I am encountering a logic problem with determining the start of the week. Below is a snippet of the code:
WeekStarts(WeekN) {
let WeekBD = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
let ArrIndex = WeekBD.findIndex(WeekN);
for (let u = 0; u < WeekBD.length; u++) {
if (ArrIndex == 6) {
} else {
}
}
}
When selecting a day from a range of Monday to Sunday, the goal is to then choose that day as the starting point and select the next 5 days of the week.
For example, if Saturday is chosen as the starting day of the week, the total duration would be 5 days, spanning from Saturday to Wednesday, skipping Thursday and Friday.