fix todays opening hours being off by one day
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
startOfToday,
|
startOfToday,
|
||||||
isAfter,
|
isAfter,
|
||||||
|
getISODay,
|
||||||
parseISO,
|
parseISO,
|
||||||
isSameDay,
|
isSameDay,
|
||||||
compareDesc,
|
compareDesc,
|
||||||
@ -199,7 +200,7 @@ export function getTodaysOpeningHoursForFunction(
|
|||||||
if (!week) {
|
if (!week) {
|
||||||
return "?";
|
return "?";
|
||||||
}
|
}
|
||||||
const weekdayIndex = startOfToday().getDay();
|
const weekdayIndex = getISODay(startOfToday()) - 1;
|
||||||
const weekday = WEEKDAYS[weekdayIndex];
|
const weekday = WEEKDAYS[weekdayIndex];
|
||||||
const hours = week[weekday];
|
const hours = week[weekday];
|
||||||
if (hours.timeFrom && hours.timeTo) {
|
if (hours.timeFrom && hours.timeTo) {
|
||||||
|
Reference in New Issue
Block a user