client: Fix relative timestamps

This commit is contained in:
Norm 2022-10-05 02:17:32 -04:00
parent c20352b22e
commit 27cf3c4e05
Signed by untrusted user: norm
GPG key ID: 7123E30E441E80DE

View file

@ -52,9 +52,9 @@ const relative = $computed(() => {
if (ago >= HOUR) {
return i18n.t('_ago.hoursAgo', { n: Math.round(ago / HOUR).toString() });
} else if (ago >= MINUTE) {
return i18n.t('_ago.minutesAgo', { n: (~~(ago / MINUTE)).toString() });
return i18n.t('_ago.minutesAgo', { n: Math.floor(ago / MINUTE).toString() });
} else if (ago >= 10 * SECOND) {
return i18n.t('_ago.secondsAgo', { n: (~~(ago % MINUTE)).toString() });
return i18n.t('_ago.secondsAgo', { n: Math.floor(ago / SECOND).toString() });
}
}