File tree Expand file tree Collapse file tree 4 files changed +23
-5
lines changed
Expand file tree Collapse file tree 4 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -17,5 +17,11 @@ export default {
1717 remark : 'Remarks' ,
1818 update : 'Update' ,
1919 authorize : 'Authorized'
20+ } ,
21+ time : {
22+ daysLater : 'days later' ,
23+ hoursLater : 'hours later' ,
24+ expired : 'expired' ,
25+ expiringSoon : 'expiring soon'
2026 }
2127}
Original file line number Diff line number Diff line change @@ -16,5 +16,11 @@ export default {
1616 remark : '备注' ,
1717 update : '更新' ,
1818 authorize : '授权给'
19+ } ,
20+ time : {
21+ daysLater : '天后' ,
22+ hoursLater : '小时后' ,
23+ expired : '已过期' ,
24+ expiringSoon : '即将到期'
1925 }
2026}
Original file line number Diff line number Diff line change @@ -17,5 +17,11 @@ export default {
1717 remark : '備註' ,
1818 update : '更新' ,
1919 authorize : '授權給'
20+ } ,
21+ time : {
22+ daysLater : '天後' ,
23+ hoursLater : '小時後' ,
24+ expired : '已過期' ,
25+ expiringSoon : '即將到期'
2026 }
2127}
Original file line number Diff line number Diff line change 11import moment from 'moment'
22import 'moment/dist/locale/zh-cn'
33moment . locale ( 'zh-cn' )
4-
4+ import { t } from '@/locales'
55// 当天日期 YYYY-MM-DD
66export const nowDate = moment ( ) . format ( 'YYYY-MM-DD' )
77
@@ -64,15 +64,15 @@ export function fromNowDate(time: any) {
6464 return ''
6565 } else {
6666 if ( exceedDay < 7 && exceedDay > 0 ) {
67- return exceedDay + '天后'
67+ return exceedDay + t ( 'layout.time.daysLater' )
6868 } else {
6969 if ( exceedHour < 24 && exceedHour > 0 ) {
70- return exceedHour + '小时后'
70+ return exceedHour + t ( 'layout.time.hoursLater' )
7171 } else {
7272 if ( exceedMin < 0 ) {
73- return '已过期'
73+ return t ( 'layout.time.expired' )
7474 } else {
75- return '即将到期'
75+ return t ( 'layout.time.expiringSoon' )
7676 }
7777 }
7878 }
You can’t perform that action at this time.
0 commit comments