mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-29 07:52:50 +00:00
fix: time language
This commit is contained in:
parent
663a6cad43
commit
cabd6fb7f5
|
|
@ -17,5 +17,11 @@ export default {
|
|||
remark: 'Remarks',
|
||||
update: 'Update',
|
||||
authorize: 'Authorized'
|
||||
},
|
||||
time: {
|
||||
daysLater: 'days later',
|
||||
hoursLater: 'hours later',
|
||||
expired: 'expired',
|
||||
expiringSoon: 'expiring soon'
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,5 +16,11 @@ export default {
|
|||
remark: '备注',
|
||||
update: '更新',
|
||||
authorize: '授权给'
|
||||
},
|
||||
time: {
|
||||
daysLater: '天后',
|
||||
hoursLater: '小时后',
|
||||
expired: '已过期',
|
||||
expiringSoon: '即将到期'
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,5 +17,11 @@ export default {
|
|||
remark: '備註',
|
||||
update: '更新',
|
||||
authorize: '授權給'
|
||||
},
|
||||
time: {
|
||||
daysLater: '天後',
|
||||
hoursLater: '小時後',
|
||||
expired: '已過期',
|
||||
expiringSoon: '即將到期'
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import moment from 'moment'
|
||||
import 'moment/dist/locale/zh-cn'
|
||||
moment.locale('zh-cn')
|
||||
|
||||
import { t } from '@/locales'
|
||||
// 当天日期 YYYY-MM-DD
|
||||
export const nowDate = moment().format('YYYY-MM-DD')
|
||||
|
||||
|
|
@ -64,15 +64,15 @@ export function fromNowDate(time: any) {
|
|||
return ''
|
||||
} else {
|
||||
if (exceedDay < 7 && exceedDay > 0) {
|
||||
return exceedDay + '天后'
|
||||
return exceedDay + t('layout.time.daysLater')
|
||||
} else {
|
||||
if (exceedHour < 24 && exceedHour > 0) {
|
||||
return exceedHour + '小时后'
|
||||
return exceedHour + t('layout.time.hoursLater')
|
||||
} else {
|
||||
if (exceedMin < 0) {
|
||||
return '已过期'
|
||||
return t('layout.time.expired')
|
||||
} else {
|
||||
return '即将到期'
|
||||
return t('layout.time.expiringSoon')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue