[F.END] Avoid empty categories

This commit is contained in:
giuliof 2020-04-17 23:13:47 +02:00
parent 78483e17ea
commit 1b0894b74d
1 changed files with 8 additions and 6 deletions

View File

@ -96,12 +96,14 @@ function zerocalcareDisplay() {
eventElement.appendChild(dateElement);
eventElement.appendChild(timeElement);
eventElement.appendChild(locationElement);
if ('Corsi' in json_obj[i]['CATEGORIES']) {
eventsContainer[Corsi].appendChild(eventElement);
}
else {
coursesContainer[Eventi].appendChild(eventElement);
if (typeof json_obj[i]['CATEGORIES'] === 'object') {
if ('Corsi' in json_obj[i]['CATEGORIES']) {
eventsContainer[Corsi].appendChild(eventElement);
}
else {
coursesContainer[Eventi].appendChild(eventElement);
}
}
}
}