From f6c86285d9aafc5a0fbcb3bd08329a002a0a54f0 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Tue, 28 Dec 2021 23:39:26 +0100 Subject: [PATCH] Select current day on angeltype/room shifts list --- includes/controller/angeltypes_controller.php | 2 +- includes/controller/rooms_controller.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/controller/angeltypes_controller.php b/includes/controller/angeltypes_controller.php index ea083774..6d2380b1 100644 --- a/includes/controller/angeltypes_controller.php +++ b/includes/controller/angeltypes_controller.php @@ -253,7 +253,7 @@ function angeltype_controller_shiftsFilter($angeltype, $days) [$angeltype['id']] ); $selected_day = date('Y-m-d'); - if (!empty($days)) { + if (!empty($days) && !in_array($selected_day, $days)) { $selected_day = $days[0]; } if ($request->has('shifts_filter_day')) { diff --git a/includes/controller/rooms_controller.php b/includes/controller/rooms_controller.php index 539d5d67..b9f299d4 100644 --- a/includes/controller/rooms_controller.php +++ b/includes/controller/rooms_controller.php @@ -37,7 +37,7 @@ function room_controller(): array AngelType_ids() ); $selected_day = date('Y-m-d'); - if (!empty($days)) { + if (!empty($days) && !in_array($selected_day, $days)) { $selected_day = $days[0]; } if ($request->has('shifts_filter_day')) {