From 29760fbe01b2ae92fb4e448e47995f0859cf9e59 Mon Sep 17 00:00:00 2001 From: naskya Date: Wed, 13 Sep 2023 08:04:04 +0000 Subject: [PATCH] chore: round down elapsed time --- packages/client/src/components/global/MkTime.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/client/src/components/global/MkTime.vue b/packages/client/src/components/global/MkTime.vue index a8819c610..8e25b6d78 100644 --- a/packages/client/src/components/global/MkTime.vue +++ b/packages/client/src/components/global/MkTime.vue @@ -44,15 +44,15 @@ const relative = computed(() => { const ago = (now.value - _time) / 1000; /* ms */ return ago >= 31536000 - ? i18n.t("_ago.yearsAgo", { n: Math.round(ago / 31536000).toString() }) + ? i18n.t("_ago.yearsAgo", { n: Math.floor(ago / 31536000).toString() }) : ago >= 2592000 - ? i18n.t("_ago.monthsAgo", { n: Math.round(ago / 2592000).toString() }) + ? i18n.t("_ago.monthsAgo", { n: Math.floor(ago / 2592000).toString() }) : ago >= 604800 - ? i18n.t("_ago.weeksAgo", { n: Math.round(ago / 604800).toString() }) + ? i18n.t("_ago.weeksAgo", { n: Math.floor(ago / 604800).toString() }) : ago >= 86400 - ? i18n.t("_ago.daysAgo", { n: Math.round(ago / 86400).toString() }) + ? i18n.t("_ago.daysAgo", { n: Math.floor(ago / 86400).toString() }) : ago >= 3600 - ? i18n.t("_ago.hoursAgo", { n: Math.round(ago / 3600).toString() }) + ? i18n.t("_ago.hoursAgo", { n: Math.floor(ago / 3600).toString() }) : ago >= 60 ? i18n.t("_ago.minutesAgo", { n: (~~(ago / 60)).toString() }) : ago >= 10