23 hours should also show as 1 day

This commit is contained in:
Berry de Vos 2024-03-10 06:27:23 +01:00
parent d3abf7decb
commit 70bfe1c2d3

View file

@ -6,7 +6,8 @@ export const parseIntro = (initialRun: boolean, itemCount: number, from: Dayjs)
} }
const hours = dayjs().diff(from, 'hours') 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) { if (days === 1) {
return `${itemCount} updates since yesterday` return `${itemCount} updates since yesterday`