diff options
| author | Johann150 <johann.galle@protonmail.com> | 2022-01-28 07:29:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-28 15:29:24 +0900 |
| commit | 29b33b37eef2c34318a5da002f4705467a82c1de (patch) | |
| tree | 798767180181f793bfe0947fc5f4f60d8a1144b7 /packages/client/src/components | |
| parent | fix(client): DMページでメンションが含まれる問題を修正 (diff) | |
| download | misskey-29b33b37eef2c34318a5da002f4705467a82c1de.tar.gz misskey-29b33b37eef2c34318a5da002f4705467a82c1de.tar.bz2 misskey-29b33b37eef2c34318a5da002f4705467a82c1de.zip | |
round relative time (#8199)
Diffstat (limited to 'packages/client/src/components')
| -rw-r--r-- | packages/client/src/components/global/time.vue | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/client/src/components/global/time.vue b/packages/client/src/components/global/time.vue index 19199fd408..5748d9de61 100644 --- a/packages/client/src/components/global/time.vue +++ b/packages/client/src/components/global/time.vue @@ -24,11 +24,11 @@ let now = $ref(new Date()); const relative = $computed(() => { const ago = (now.getTime() - _time.getTime()) / 1000/*ms*/; return ( - ago >= 31536000 ? i18n.t('_ago.yearsAgo', { n: (~~(ago / 31536000)).toString() }) : - ago >= 2592000 ? i18n.t('_ago.monthsAgo', { n: (~~(ago / 2592000)).toString() }) : - ago >= 604800 ? i18n.t('_ago.weeksAgo', { n: (~~(ago / 604800)).toString() }) : - ago >= 86400 ? i18n.t('_ago.daysAgo', { n: (~~(ago / 86400)).toString() }) : - ago >= 3600 ? i18n.t('_ago.hoursAgo', { n: (~~(ago / 3600)).toString() }) : + ago >= 31536000 ? i18n.t('_ago.yearsAgo', { n: Math.round(ago / 31536000).toString() }) : + ago >= 2592000 ? i18n.t('_ago.monthsAgo', { n: Math.round(ago / 2592000).toString() }) : + ago >= 604800 ? i18n.t('_ago.weeksAgo', { n: Math.round(ago / 604800).toString() }) : + ago >= 86400 ? i18n.t('_ago.daysAgo', { n: Math.round(ago / 86400).toString() }) : + ago >= 3600 ? i18n.t('_ago.hoursAgo', { n: Math.round(ago / 3600).toString() }) : ago >= 60 ? i18n.t('_ago.minutesAgo', { n: (~~(ago / 60)).toString() }) : ago >= 10 ? i18n.t('_ago.secondsAgo', { n: (~~(ago % 60)).toString() }) : ago >= -1 ? i18n.ts._ago.justNow : |