Renamed the checkDate function to checkAppointmentDate for clarity