diff --git a/plugin/src/data/dueDateFormatter.ts b/plugin/src/data/dueDateFormatter.ts index 22f4f8d..13925a2 100644 --- a/plugin/src/data/dueDateFormatter.ts +++ b/plugin/src/data/dueDateFormatter.ts @@ -1,6 +1,7 @@ import type { DueDate } from "@/data/dueDate"; import { t } from "@/i18n"; import { locale } from "@/infra/locale"; +import { timezone } from "@/infra/time"; const formatStyles: Record = { time: { @@ -27,7 +28,10 @@ const getFormatter = (style: string): Intl.DateTimeFormat => { return formatterCache[style]; } - formatterCache[style] = new Intl.DateTimeFormat(locale(), formatStyles[style]); + formatterCache[style] = new Intl.DateTimeFormat(locale(), { + timeZone: timezone(), + ...formatStyles[style], + }); return formatterCache[style]; }; diff --git a/plugin/src/data/transformations/grouping.test.ts b/plugin/src/data/transformations/grouping.test.ts index e87854b..9f20543 100644 --- a/plugin/src/data/transformations/grouping.test.ts +++ b/plugin/src/data/transformations/grouping.test.ts @@ -16,6 +16,12 @@ vi.mock("../../infra/time.ts", () => { }; }); +vi.mock("../../infra/locale.ts", () => { + return { + locale: () => "en-US", + }; +}); + function makeTask(id: string, opts?: Partial): Task { return { id,