From 9d4849fd42d87ec947f43b2f333f7c78521d66c8 Mon Sep 17 00:00:00 2001 From: ktmouk Date: Thu, 20 Jun 2024 22:51:55 +0900 Subject: [PATCH] fix: calculating the difference in days is not correct (#6) --- .../src/app/[locale]/app/(home)/_components/TimeEntryList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/[locale]/app/(home)/_components/TimeEntryList.tsx b/apps/web/src/app/[locale]/app/(home)/_components/TimeEntryList.tsx index 6a1efaa..77e432b 100644 --- a/apps/web/src/app/[locale]/app/(home)/_components/TimeEntryList.tsx +++ b/apps/web/src/app/[locale]/app/(home)/_components/TimeEntryList.tsx @@ -60,7 +60,7 @@ export const TimeEntryList = ({ date, timeEntries }: Props) => { new Intl.RelativeTimeFormat(locale, { numeric: "auto", }).format( - differenceInDays(startOfDay(new Date()), startOfDay(date)), + differenceInDays(startOfDay(date), startOfDay(new Date())), "day", ), );