event - update mapado infos on update

This commit is contained in:
isUnknown 2024-07-30 19:03:01 +02:00
parent 6df3927970
commit c1a94e832f
10 changed files with 215 additions and 11 deletions

View file

@ -8,5 +8,18 @@
</div>
</div>
<?php snippet('calendar-strip') ?>
<?php snippet('events-grid') ?>
<?php
$currentSeason = page('programme')->children()->first()->children();
$orderedEvents = $currentSeason->sortBy(function ($event) {
if ($event->isMapadoEvent() == 'true') {
return $event->remoteSessions()->toStructure()->toArray()[0]['date'];
} else {
return $event->sessions()->toStructure()->toArray()[0]['date'];
}
},
'asc'
);
snippet('events-grid', ['events' => $orderedEvents->limit(2)])
?>
<?php snippet('footer') ?>