fix todays opening hours being off by one day

This commit is contained in:
2024-08-18 03:25:15 +02:00
parent 5145224639
commit b304d57bf5

View File

@ -1,6 +1,7 @@
import {
startOfToday,
isAfter,
getISODay,
parseISO,
isSameDay,
compareDesc,
@ -199,7 +200,7 @@ export function getTodaysOpeningHoursForFunction(
if (!week) {
return "?";
}
const weekdayIndex = startOfToday().getDay();
const weekdayIndex = getISODay(startOfToday()) - 1;
const weekday = WEEKDAYS[weekdayIndex];
const hours = week[weekday];
if (hours.timeFrom && hours.timeTo) {