Fix rendering of schedule for 2015

This commit is contained in:
Vencislav Atanasov 2016-10-22 03:30:31 +03:00
parent da5810e68b
commit 3b74bc0053
1 changed files with 6 additions and 2 deletions

View File

@ -23,6 +23,10 @@ function parseData($config, $data) {
$moments = []; $moments = [];
$data['slots'] = array_filter($data['slots'], function($slot) {
return isset($slot['starts_at'], $slot['ends_at'], $slot['hall_id'], $slot['event_id']);
});
$data['slots'] = array_map(function($slot) { $data['slots'] = array_map(function($slot) {
$slot['start'] = date('d.m H:i', $slot['starts_at']); $slot['start'] = date('d.m H:i', $slot['starts_at']);
$slot['end'] = date('d.m H:i', $slot['ends_at']); $slot['end'] = date('d.m H:i', $slot['ends_at']);
@ -135,7 +139,7 @@ function parseData($config, $data) {
$hasEvents = false; $hasEvents = false;
foreach ($events as $hall_index => $event) { foreach ($events as $hall_index => $event) {
if (is_null($event['event_id'])) { if (is_null($event['event_id']) || !array_key_exists($event['event_id'], $data['events'])) {
$columns[] = '<td>&nbsp;</td>'; $columns[] = '<td>&nbsp;</td>';
continue; continue;
} }