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
This commit is contained in:
Guilhem
2026-11-25 22:45:39 +01:00
committed by GitHub
parent 2b7c7e98ac
commit b59d27bdb1
+4 -1
View File
@@ -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' })}`