From 2252819800d3b958ba5660e392c6f1b0ee8ecffe Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sat, 19 Aug 2023 16:23:01 +0200 Subject: [PATCH] Shifts preview: added end year on hover and hours --- includes/pages/admin_shifts.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/includes/pages/admin_shifts.php b/includes/pages/admin_shifts.php index 80d85c71..bbf58ad9 100644 --- a/includes/pages/admin_shifts.php +++ b/includes/pages/admin_shifts.php @@ -310,13 +310,20 @@ function admin_shifts() $shifts_table = []; foreach ($shifts as $shift) { + /** @var Carbon $start */ + $start = $shift['start']; + /** @var Carbon $end */ + $end = $shift['end']; $shifts_table_entry = [ 'timeslot' => icon('clock-history') . ' ' - . $shift['start']->format(__('Y-m-d H:i')) + . $start->format(__('Y-m-d H:i')) . ' - ' - . $shift['end']->format(__('H:i')) - . '
' + . '' + . $end->format(__('H:i')) + . '' + . ', ' . round($end->copy()->diffInMinutes($start) / 60, 2) . 'h' + . '
' . Room_name_render(Room::find($shift['room_id'])), 'title' => ShiftType_name_render(ShiftType::find($shifttype_id))