From 27cf3c4e0525b25f4263f267ca2cad4fc64c08bf Mon Sep 17 00:00:00 2001 From: Francis Dinh Date: Wed, 5 Oct 2022 02:17:32 -0400 Subject: [PATCH] client: Fix relative timestamps --- packages/client/src/components/global/time.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/global/time.vue b/packages/client/src/components/global/time.vue index cc872096c..1d1366068 100644 --- a/packages/client/src/components/global/time.vue +++ b/packages/client/src/components/global/time.vue @@ -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() }); } }