fix(server): 业务日期'今天'统一为中国日期,避免凌晨 UTC 偏一天
joinDate/leaveDate/checkInDate/sync 起始日等业务日期默认值原来用 dayjs().utc()(UTC 今天),在国内 00:00-07:59 会取到昨天。 统一改为 dayjs().utcOffset(8)(固定 UTC+8 中国日期),与考勤周边界 修复保持一致;pending-tasks/controller-base 的本地 dayjs() 也显式化。
This commit is contained in:
@@ -46,7 +46,7 @@ export class ScheduleSyncService {
|
||||
opUserId = 'manager',
|
||||
attendanceMachineOnly = false,
|
||||
): Promise<ScheduleSyncResult> {
|
||||
const startDate = dateFrom || dayjs().utc().format('YYYY-MM-DD');
|
||||
const startDate = dateFrom || dayjs().utcOffset(8).format('YYYY-MM-DD');
|
||||
const normalizedDays = Number.isFinite(days) ? Math.max(1, Math.floor(days)) : 30;
|
||||
const endDate = addDays(startDate, normalizedDays - 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user