diff --git a/application/controllers/Appointments.php b/application/controllers/Appointments.php index 04401f60..5d3df41f 100755 --- a/application/controllers/Appointments.php +++ b/application/controllers/Appointments.php @@ -926,6 +926,11 @@ class Appointments extends CI_Controller { { $appointment_start = new DateTime($provider_appointment['start_datetime']); $appointment_end = new DateTime($provider_appointment['end_datetime']); + + if ($appointment_start >= $appointment_end) { + continue; + } + $period_start = new DateTime($selected_date . ' ' . $period['start']); $period_end = new DateTime($selected_date . ' ' . $period['end']);