From aaabf7638c9210661f97451607fa5b99f04328d6 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Mon, 4 Nov 2024 16:11:36 +0100 Subject: [PATCH] #15 program > calendar, do not show previous month --- site/controllers/program.php | 47 +++++++++++++++--------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/site/controllers/program.php b/site/controllers/program.php index 0fc9eff..51697ed 100644 --- a/site/controllers/program.php +++ b/site/controllers/program.php @@ -1,44 +1,37 @@ = $currentMonthIndex || $monthIndex < 8) { + $month = date('F', strtotime($item['date'])); + $monthInFrench = str_replace($englishMonths, $frenchMonths, $month); + + if (!isset($orderedSessions[$monthInFrench])) { + $orderedSessions[$monthInFrench] = []; + } + + $orderedSessions[$monthInFrench][] = $item; + } } return $orderedSessions; } + function createArraySession($event, $session) { $isMapadoEvent = $event->isMapadoEvent() == 'true'; $arraySession = $session->toArray();