diff --git a/src/pages/index/DutyInfo.tsx b/src/pages/index/DutyInfo.tsx index bba7fa5..d25122b 100644 --- a/src/pages/index/DutyInfo.tsx +++ b/src/pages/index/DutyInfo.tsx @@ -15,7 +15,7 @@ export class DutyData { this.currentDuty = '1'; this.otherDutyStart = '2024-03-07T13:30:48.523303'; this.otherDutyEnd = '2024-03-07T16:00:48.523303'; - this.dutyRecoverTime = '明天 13:30'; + this.dutyRecoverTime = '13:30'; this.place = '东三-204'; } diff --git a/src/plain-text/common.ts b/src/plain-text/common.ts index 47fa3ee..739038e 100644 --- a/src/plain-text/common.ts +++ b/src/plain-text/common.ts @@ -1,4 +1,6 @@ -import { Moment } from 'moment'; +import moment, { Moment } from 'moment'; + +const dutyStart = moment().format('YYYY-MM-DD').toString() + ' 13:30:00'; export interface CommonText { createdAtText(time: Moment): string; @@ -14,7 +16,7 @@ export const commonTextZhCn: CommonText = { }, offDutyReason: '正常值班下班', place: '204', - dutyRecoverTime: '明天 13:30', + dutyRecoverTime: moment().isBefore(dutyStart) ? '今天 13:30' : '明天 13:30', zeroMemberOnDuty: '待更新', }; @@ -24,6 +26,8 @@ export const commonTextEnUs: CommonText = { }, offDutyReason: 'Normal Shift', place: 'E3-204', - dutyRecoverTime: 'Tomorrow 13:30', + dutyRecoverTime: moment().isBefore(dutyStart) + ? '13:30 Today' + : '13:30 Tomorrow', zeroMemberOnDuty: 'Wait for update', };