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

@ -194,7 +194,16 @@ function parseData($config, $data) {
$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)) {
$master_slot['rowspan'] = 2;