fix(schedule): calendar

This commit is contained in:
avicenan
2026-04-19 23:14:09 +07:00
parent 1bd0f081d7
commit e88c6cf0db

View File

@ -134,8 +134,8 @@ export class ScheduleModel {
const doctor = exception?.override_doctor ?? series.doctor; const doctor = exception?.override_doctor ?? series.doctor;
const room = exception?.override_room ?? series.room; const room = exception?.override_room ?? series.room;
const eventStart = exception?.override_start_at ? new Date(exception.override_start_at) : defaultStart; const eventStart = exception?.override_start_at ? exception.override_start_at : defaultStart;
const eventEnd = exception?.override_end_at ? new Date(exception.override_end_at) : defaultEnd; const eventEnd = exception?.override_end_at ? exception.override_end_at : defaultEnd;
const eventTitle = exception?.override_title || series.title; const eventTitle = exception?.override_title || series.title;
const roomId = room?.id || null; const roomId = room?.id || null;
@ -151,8 +151,8 @@ export class ScheduleModel {
room_name: roomName, room_name: roomName,
doctor_id: doctorId, doctor_id: doctorId,
doctor_name: doctorName, doctor_name: doctorName,
start_at: eventStart.toISOString(), start_at: eventStart,
end_at: eventEnd.toISOString(), end_at: eventEnd,
quota: series.quota ?? null, quota: series.quota ?? null,
used_quota: usageMap.get(`${series.id}:${occurrenceYmd}`) || 0, used_quota: usageMap.get(`${series.id}:${occurrenceYmd}`) || 0,
left_quota: left_quota:
@ -462,8 +462,8 @@ export class ScheduleModel {
}; };
} }
private static combineDateAndTime(ymd: string, hhmmss: string): Date { private static combineDateAndTime(ymd: string, hhmmss: string) {
return new Date(`${ymd}T${hhmmss}`); return `${ymd} ${hhmmss}`;
} }
private static startOfDay(date: Date): Date { private static startOfDay(date: Date): Date {