mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-11-28 08:06:16 +00:00
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:
@@ -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' })}`
|
||||
|
||||
Reference in New Issue
Block a user