From c5aeccf58fc0d3eb4a24186921d338f041a14241 Mon Sep 17 00:00:00 2001 From: ramvignesh-b Date: Thu, 16 Apr 2026 05:56:52 +0530 Subject: [PATCH] fix: force en-US locale in Intl formatters to ensure consistent date and time output --- frontend/src/utils/dateFormat.ts | 6 +++--- frontend/vitest.config.ts | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/src/utils/dateFormat.ts b/frontend/src/utils/dateFormat.ts index 6b583d8..92acd02 100644 --- a/frontend/src/utils/dateFormat.ts +++ b/frontend/src/utils/dateFormat.ts @@ -1,13 +1,13 @@ -const timeFormatter = new Intl.DateTimeFormat(undefined, { +const timeFormatter = new Intl.DateTimeFormat("en-US", { timeStyle: "short", }); -const dateTimeFormatter = new Intl.DateTimeFormat(undefined, { +const dateTimeFormatter = new Intl.DateTimeFormat("en-US", { dateStyle: "medium", timeStyle: "short", }); -const rtf = new Intl.RelativeTimeFormat(undefined, { +const rtf = new Intl.RelativeTimeFormat("en-US", { numeric: "auto", }); diff --git a/frontend/vitest.config.ts b/frontend/vitest.config.ts index 4b9fc24..0b301d2 100644 --- a/frontend/vitest.config.ts +++ b/frontend/vitest.config.ts @@ -8,7 +8,6 @@ export default defineConfig({ test: { env: { VITE_API_URL: "http://piku-server", - TZ: "Asia/Kolkata", }, include: ["**/*.test.ts"], environment: "jsdom",