diff --git a/site/plugins/helpers/index.php b/site/plugins/helpers/index.php index d519e42..b10ad79 100644 --- a/site/plugins/helpers/index.php +++ b/site/plugins/helpers/index.php @@ -54,34 +54,6 @@ function splitNextAndPreviousEvents($events) { ]; } -function filterPastEvents($events) { - $pastEvents = new Pages(); - - foreach ($events as $event) { - $sessions = $event->isMapadoEvent() == 'true' ? $event->remoteSessions()->toStructure() : $event->sessions()->toStructure(); - - $sessionDates = $sessions->map(function($session) { - return $session->date()->value(); - })->data; - - $pastDates = array_filter($sessionDates, function ($date) { - // strtotime() gives the timestamp for midnight - // time() gives the current timestamp so if the event occurs today it will be considered as past after midnight - // so we need to add a day, in seconds - $oneDayInSecond = 24*60*60; - $oneDayInSecond = 24*60*60; - $dateTimeStamp = strtotime($date) - $oneDayInSecond; - return $date < time(); - }); - - if (count($pastDates) == count($sessionDates)) { - $pastEvents->add($event); - } - } - - return $pastEvents; -} - function buildFieldsString($requestFields) { $fields = []; foreach ($requestFields as $field) {