From b40e07fd64eb5a927b92065bc425240f918a9166 Mon Sep 17 00:00:00 2001 From: Trillium Smith Date: Sat, 17 Jun 2023 19:17:27 -0700 Subject: [PATCH] fix: Force getDateRangeInterval to use "Etc/GMT" Resolves timezone bug with getDateRangeInterval --- components/availability/date/Calendar.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/availability/date/Calendar.tsx b/components/availability/date/Calendar.tsx index 870a3db..31b503c 100644 --- a/components/availability/date/Calendar.tsx +++ b/components/availability/date/Calendar.tsx @@ -21,6 +21,7 @@ export default function Calendar({ const { start: startDate, end: endDate } = getDateRangeInterval({ start, end, + timeZone: "Etc/GMT", }) // Handles when the date changes due to the selected timezone @@ -32,7 +33,7 @@ export default function Calendar({ // an incomplete row. end: endOfWeek(addDays(endDate, 2)), }).map((day) => Day.dayFromDate(day)) - + // Remove cases where the first week is empty. // (Usually timezone changing related) const firstWeek = days.at(6)