chore: fix LIMCO courses' names

pull/13/head
Francesco Minnocci 6 months ago
parent 62a9b80b21
commit d9d2aaed11
No known key found for this signature in database
GPG Key ID: 76DA3AF9BAED1A32

@ -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]),

@ -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) {

Loading…
Cancel
Save