improvement: some improvement done for appointment and treatment shared components.

This commit is contained in:
2026-07-17 11:21:08 +03:30
parent d2ad1fd7b6
commit 1b63bfff00
12 changed files with 204 additions and 38 deletions

View File

@@ -203,13 +203,16 @@ export function AppointmentBookingModal({
}
const now = new Date();
if (isSameLocalCalendarDay(scheduleDate, now) && startAt.getTime() < now.getTime()) {
if (
!editingAppointment &&
isSameLocalCalendarDay(scheduleDate, now) &&
startAt.getTime() < now.getTime()
) {
setError(t('errorPastSchedule'));
return;
}
const today = new Date();
if (compareLocalDayStart(scheduleDate, today) < 0) {
if (!editingAppointment && compareLocalDayStart(scheduleDate, now) < 0) {
setError(t('errorPastViewOnly'));
return;
}