From b59d27bdb1daaa0e3fbacc3cfb692b01fe7254d3 Mon Sep 17 00:00:00 2001 From: Guilhem Date: Wed, 25 Nov 2026 22:45:39 +0100 Subject: [PATCH] fix: show minutes instead of seconds after the first minute in relative times (#12631) * fix: show minutes instead of seconds after the first minute in relative times * fix: switch to the exact time after 10 minutes in relative times --- frontend/src/lib/components/TimeAgo.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/TimeAgo.svelte b/frontend/src/lib/components/TimeAgo.svelte index 1e5515f144..844cac69c5 100644 --- a/frontend/src/lib/components/TimeAgo.svelte +++ b/frontend/src/lib/components/TimeAgo.svelte @@ -168,8 +168,11 @@ // Original mode const nbSecondsAgo = secondsAgo(date) - if (nbSecondsAgo < 600) { + if (nbSecondsAgo < 60) { return `${nbSecondsAgo}s ago` + } else if (nbSecondsAgo < 600) { + const mins = Math.floor(nbSecondsAgo / 60) + return `${mins} min${mins !== 1 ? 's' : ''} ago` } else if (isToday(date)) { isRecent = false return `today at ${date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`