fix: default dutyRecoverTime

mgy
Dawn1Ocean 2024-05-10 12:04:21 +08:00
parent 669896d253
commit 6f960d46a8
2 changed files with 8 additions and 4 deletions

View File

@ -15,7 +15,7 @@ export class DutyData {
this.currentDuty = '1'; this.currentDuty = '1';
this.otherDutyStart = '2024-03-07T13:30:48.523303'; this.otherDutyStart = '2024-03-07T13:30:48.523303';
this.otherDutyEnd = '2024-03-07T16:00:48.523303'; this.otherDutyEnd = '2024-03-07T16:00:48.523303';
this.dutyRecoverTime = '明天 1330'; this.dutyRecoverTime = '1330';
this.place = '东三-204'; this.place = '东三-204';
} }

View File

@ -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 { export interface CommonText {
createdAtText(time: Moment): string; createdAtText(time: Moment): string;
@ -14,7 +16,7 @@ export const commonTextZhCn: CommonText = {
}, },
offDutyReason: '正常值班下班', offDutyReason: '正常值班下班',
place: '204', place: '204',
dutyRecoverTime: '明天 13:30', dutyRecoverTime: moment().isBefore(dutyStart) ? '今天 13:30' : '明天 13:30',
zeroMemberOnDuty: '待更新', zeroMemberOnDuty: '待更新',
}; };
@ -24,6 +26,8 @@ export const commonTextEnUs: CommonText = {
}, },
offDutyReason: 'Normal Shift', offDutyReason: 'Normal Shift',
place: 'E3-204', place: 'E3-204',
dutyRecoverTime: 'Tomorrow 13:30', dutyRecoverTime: moment().isBefore(dutyStart)
? '13:30 Today'
: '13:30 Tomorrow',
zeroMemberOnDuty: 'Wait for update', zeroMemberOnDuty: 'Wait for update',
}; };