Skip to content

Commit

Permalink
CSCEXAM-478 Fix handling of weekdays with exceptional events
Browse files Browse the repository at this point in the history
  • Loading branch information
lupari committed Jun 30, 2024
1 parent a068c4f commit 33611c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/src/app/calendar/calendar.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export class CalendarService {
const extraDays = room.calendarExceptionEvents
.filter((e) => !e.outOfService && e.startDate >= start && e.endDate <= end)
.flatMap((d) => this.daysBetween(DateTime.fromISO(d.startDate), DateTime.fromISO(d.endDate)))
.map((d) => (d.start?.weekday === 7 ? 0 : (d.start as DateTime).weekday - 1)); // locale nuisances
.map((d) => (d.start?.weekday === 7 ? 0 : (d.start as DateTime).weekday)); // locale nuisances

return [0, 1, 2, 3, 4, 5, 6].filter((x) => regularDays.concat(extraDays).indexOf(x) === -1);
}
Expand Down

0 comments on commit 33611c7

Please sign in to comment.