From 6df70efc136ced460228a7bee262a6ab20ca4e4f Mon Sep 17 00:00:00 2001 From: Potenz Date: Tue, 15 Jul 2025 21:23:37 +0530 Subject: [PATCH] date issue fixed2 --- apps/Frontend/src/utils/dateUtils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/Frontend/src/utils/dateUtils.ts b/apps/Frontend/src/utils/dateUtils.ts index 00701dc..40b3a06 100644 --- a/apps/Frontend/src/utils/dateUtils.ts +++ b/apps/Frontend/src/utils/dateUtils.ts @@ -33,7 +33,10 @@ export function parseLocalDateString(dateStr: string): Date { * Useful for saving date-only data without time component. */ export function formatLocalDate(date: Date): string { - return format(date, "yyyy-MM-dd"); + const year = date.getFullYear(); // ← local time + const month = `${date.getMonth() + 1}`.padStart(2, "0"); + const day = `${date.getDate()}`.padStart(2, "0"); + return `${year}-${month}-${day}`; // e.g. "2025-07-15" } /**