Revert "Merge pull request #424 from Wangnov/feat/i18n"

This reverts commit 1d915d8327, reversing
changes made to 009f7c84f6.
This commit is contained in:
shaw
2025-09-12 09:21:53 +08:00
parent 1d915d8327
commit 9c4dc714f8
80 changed files with 7026 additions and 19087 deletions

View File

@@ -37,9 +37,7 @@ export function formatDate(date, format = 'YYYY-MM-DD HH:mm:ss') {
.replace('ss', seconds)
}
// 相对时间格式化(使用 i18n
import i18n from '@/i18n'
// 相对时间格式化
export function formatRelativeTime(date) {
if (!date) return ''
@@ -52,13 +50,13 @@ export function formatRelativeTime(date) {
const diffDays = Math.floor(diffHours / 24)
if (diffDays > 0) {
return i18n.global.t('common.time.daysAgo', { days: diffDays })
return `${diffDays}天前`
} else if (diffHours > 0) {
return i18n.global.t('common.time.hoursAgo', { hours: diffHours })
return `${diffHours}小时前`
} else if (diffMins > 0) {
return i18n.global.t('common.time.minutesAgo', { minutes: diffMins })
return `${diffMins}分钟前`
} else {
return i18n.global.t('common.time.justNow')
return '刚刚'
}
}