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