From 60e336e98c78483ca33c404a8460f32a5cfe88f4 Mon Sep 17 00:00:00 2001 From: WickyNilliams Date: Fri, 1 Nov 2024 21:12:21 +0000 Subject: [PATCH] don't use utc for calculating today --- src/utils/date.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/date.ts b/src/utils/date.ts index 2986f32..a3beb1a 100644 --- a/src/utils/date.ts +++ b/src/utils/date.ts @@ -3,7 +3,8 @@ import { PlainDate, type PlainYearMonth } from "./temporal.js"; export type DaysOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6; export function today() { - return PlainDate.from(new Date()); + const d = new Date(); + return new PlainDate(d.getFullYear(), d.getMonth() + 1, d.getDate()); } export function startOfWeek(