From 59df22314f707b488778de93b71f2103a18dbc8a Mon Sep 17 00:00:00 2001 From: twobiers <22715034+twobiers@users.noreply.github.com> Date: Tue, 28 Jan 2025 20:56:20 +0100 Subject: [PATCH] Return plain date for start/end day check --- src/utils/dateUtils.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/utils/dateUtils.ts b/src/utils/dateUtils.ts index 21aa71d9..68bc8b96 100644 --- a/src/utils/dateUtils.ts +++ b/src/utils/dateUtils.ts @@ -100,9 +100,7 @@ export function getStartAndEndDay(instant: Temporal.Instant, timeZone = "Europe/ const today = Temporal.PlainDate.from(instant.toZonedDateTimeISO(timeZone)); const tomorrow = today.add({ days: 1 }); - const startOfToday = today.toZonedDateTime({ timeZone: "Europe/Berlin" }); - const startOfTomorrow = tomorrow.toZonedDateTime({ - timeZone: "Europe/Berlin", - }); + const startOfToday = today.toZonedDateTime({ timeZone }).toPlainDate(); + const startOfTomorrow = tomorrow.toZonedDateTime({ timeZone }).toPlainDate(); return { startOfToday, startOfTomorrow }; }