Use the unavailabilities model to pull the proper records for the table view.

This commit is contained in:
Alex Tselegidis 2022-01-18 17:38:02 +01:00
parent 2f057ac28b
commit 628e5a2dfa

View file

@ -483,12 +483,10 @@ class Calendar extends EA_Controller {
$response = [ $response = [
'appointments' => $this->appointments_model->get([ 'appointments' => $this->appointments_model->get([
'is_unavailability' => FALSE,
'start_datetime >=' => $start_date, 'start_datetime >=' => $start_date,
'end_datetime <=' => $end_date 'end_datetime <=' => $end_date
]), ]),
'unavailability_events' => $this->appointments_model->get([ 'unavailabilities' => $this->unavailabilities_model->get([
'is_unavailability' => TRUE,
'start_datetime >=' => $start_date, 'start_datetime >=' => $start_date,
'end_datetime <=' => $end_date 'end_datetime <=' => $end_date
]) ])