diff --git a/src/main.jsx b/src/main.jsx index 3cbde47..59a7a83 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -50,15 +50,18 @@ const TIMETABLE_IDS = { // } function specialEventPatches(eventi) { - // Il laboratorio del primo anno in realtà è in due canali separati - let i = 1 + // Il laboratorio del primo anno in realtà è in due gruppi separati eventi.forEach(evento => { if ( evento.nome === 'LABORATORIO DI INTRODUZIONE ALLA MATEMATICA COMPUTAZIONALE' ) { - evento.nome += ` (${i})` - i++ + if (evento.docenti[0].nome === 'GIOVANNI') { + evento.nome += ' (A)' + } + if (evento.docenti[0].nome === 'PAOLO') { + evento.nome += ' (B)' + } } }) @@ -131,7 +134,7 @@ async function loadCalendari(date) { const timetablesRaw = results.map(timetable => specialEventPatches(_.uniqBy(timetable, 'id')) ) - const allRaw = specialEventPatches(_.uniqBy(_.concat(...results), 'id')) + const allRaw = specialEventPatches(_.concat(...results), 'id') return { 'anno-1': formatEvents(timetablesRaw[0]), diff --git a/src/utils.jsx b/src/utils.jsx index 925719b..f429e67 100644 --- a/src/utils.jsx +++ b/src/utils.jsx @@ -61,6 +61,7 @@ export function prettyCourseName(name) { .replaceAll('IIi', 'III') .replaceAll('Iii', 'III') .replaceAll(/'(.)/g, ({}, letter) => "'" + letter.toUpperCase()) + .replaceAll(/\((a|b)\)/g, ({}, letter) => "(" + letter.toUpperCase() + ")") } export function prettyAulaName(name) {