Skip to content

Commit

Permalink
Return plain date for start/end day check
Browse files Browse the repository at this point in the history
  • Loading branch information
twobiers committed Jan 28, 2025
1 parent 7d9a1e1 commit 59df223
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/utils/dateUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}

0 comments on commit 59df223

Please sign in to comment.