date issue 4

This commit is contained in:
2025-05-19 08:05:29 +05:30
parent be19ab6666
commit 490c6a22c1
2 changed files with 14 additions and 10 deletions

View File

@@ -371,10 +371,15 @@ export default function AppointmentsPage() {
const handleAppointmentSubmit = (
appointmentData: InsertAppointment | UpdateAppointment
) => {
// Make sure the date is for the selected date
const updatedData = {
...appointmentData,
date: format(selectedDate, "yyyy-MM-dd"),
date: format(
appointmentData.date instanceof Date
? appointmentData.date
: new Date(appointmentData.date),
"yyyy-MM-dd"
),
};
// Check if we're editing an existing appointment with a valid ID