From e73129c371563c68306ba9c5655947f4e6ab99f1 Mon Sep 17 00:00:00 2001 From: Marc Schwartz Date: Tue, 4 Aug 2026 10:25:24 +0200 Subject: [PATCH] fix: prevent off-by-one date from picker in non-UTC timezones --- src/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index ee6216d..278ca2b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,7 +1,9 @@ import { getCanonicalLocale } from '@nextcloud/l10n' export function toDateString(d: Date): string { - return d.toISOString().slice(0, 10) + const month = String(d.getMonth() + 1).padStart(2, '0') + const day = String(d.getDate()).padStart(2, '0') + return `${d.getFullYear()}-${month}-${day}` } const dateFormatter = new Intl.DateTimeFormat(getCanonicalLocale(), { dateStyle: 'long' })