From 275503ae8f237bb089075a69f2853a39d7ce1291 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Wed, 11 Mar 2026 23:14:35 +0100 Subject: [PATCH] fix: show dynamic comparison period label in stat headers --- components/dashboard/Chart.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/dashboard/Chart.tsx b/components/dashboard/Chart.tsx index 56b22eb..f6e4233 100644 --- a/components/dashboard/Chart.tsx +++ b/components/dashboard/Chart.tsx @@ -358,7 +358,10 @@ export default function Chart({ )} -
vs yesterday
+
{(() => { + 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` + })()}
{metric === m.key && (
)}