From 34eca6496754da80ee488ac466b0377ab3237470 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Wed, 11 Mar 2026 23:23:39 +0100 Subject: [PATCH] fix: correct off-by-one in comparison period label --- components/dashboard/Chart.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/dashboard/Chart.tsx b/components/dashboard/Chart.tsx index 8a55288..bdfa732 100644 --- a/components/dashboard/Chart.tsx +++ b/components/dashboard/Chart.tsx @@ -359,8 +359,8 @@ export default function Chart({ )}
{(() => { - const days = Math.round((new Date(dateRange.end).getTime() - new Date(dateRange.start).getTime()) / 86400000) + 1 - return days <= 1 ? 'vs yesterday' : `vs previous ${days} days` + const days = Math.round((new Date(dateRange.end).getTime() - new Date(dateRange.start).getTime()) / 86400000) + return days === 0 ? 'vs yesterday' : `vs previous ${days} days` })()}
{metric === m.key && (