Skip to content

Commit 59df223

Browse files
committed
Return plain date for start/end day check
1 parent 7d9a1e1 commit 59df223

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/utils/dateUtils.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ export function getStartAndEndDay(instant: Temporal.Instant, timeZone = "Europe/
100100
const today = Temporal.PlainDate.from(instant.toZonedDateTimeISO(timeZone));
101101
const tomorrow = today.add({ days: 1 });
102102

103-
const startOfToday = today.toZonedDateTime({ timeZone: "Europe/Berlin" });
104-
const startOfTomorrow = tomorrow.toZonedDateTime({
105-
timeZone: "Europe/Berlin",
106-
});
103+
const startOfToday = today.toZonedDateTime({ timeZone }).toPlainDate();
104+
const startOfTomorrow = tomorrow.toZonedDateTime({ timeZone }).toPlainDate();
107105
return { startOfToday, startOfTomorrow };
108106
}

0 commit comments

Comments
 (0)