From 70bfe1c2d390dc1ae7c3e57d6c17597132fa06c5 Mon Sep 17 00:00:00 2001 From: Berry de Vos Date: Sun, 10 Mar 2024 06:27:23 +0100 Subject: [PATCH] 23 hours should also show as 1 day --- src/email/parseIntro.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/email/parseIntro.ts b/src/email/parseIntro.ts index 475384f..691e11c 100644 --- a/src/email/parseIntro.ts +++ b/src/email/parseIntro.ts @@ -6,7 +6,8 @@ export const parseIntro = (initialRun: boolean, itemCount: number, from: Dayjs) } const hours = dayjs().diff(from, 'hours') - const days = Math.floor(hours / 24) + // Add 1 to the hours so 23 hours also becomes 1 day + const days = Math.floor((hours + 1) / 24) if (days === 1) { return `${itemCount} updates since yesterday`