Fix an edge case in which an event spans over adjacent slots but in different days

This commit is contained in:
Vencislav Atanasov 2023-10-17 00:00:19 +03:00
parent 0eb9145e5a
commit 7d6ca43395
1 changed files with 11 additions and 2 deletions

View File

@ -189,12 +189,21 @@ function parseData($config, $data) {
continue; continue;
} }
// We have a long event // We have a long event
if (is_null($prevEventSlot[$hall_index])) { if (is_null($prevEventSlot[$hall_index])) {
$prevEventSlot[$hall_index] = $prevSlotIndex; $prevEventSlot[$hall_index] = $prevSlotIndex;
} }
$master_slot = &$events[$prevEventSlot[$hall_index]][$hall_index]; $masterSlotIndex = $prevEventSlot[$hall_index];
// check if the events spans on the next day
if (date('d.m', $microslots[$slot_index][0]) !== date('d.m', $microslots[$masterSlotIndex][1])) {
// not sure why this is needed, but it fixes things
$prevEventSlot[$hall_index] = null;
continue;
}
$master_slot = &$events[$masterSlotIndex][$hall_index];
if (!array_key_exists('rowspan', $master_slot)) { if (!array_key_exists('rowspan', $master_slot)) {
$master_slot['rowspan'] = 2; $master_slot['rowspan'] = 2;