Merge pull request 'chore: fix LIMCO courses' names' (#13) from dev into main
continuous-integration/drone/push Build is passing Details

Reviewed-on: #13
pull/14/head
Francesco Minnocci 7 months ago
commit c731d9c8b9

@ -50,15 +50,18 @@ const TIMETABLE_IDS = {
// } // }
function specialEventPatches(eventi) { function specialEventPatches(eventi) {
// Il laboratorio del primo anno in realtà è in due canali separati // Il laboratorio del primo anno in realtà è in due gruppi separati
let i = 1
eventi.forEach(evento => { eventi.forEach(evento => {
if ( if (
evento.nome === evento.nome ===
'LABORATORIO DI INTRODUZIONE ALLA MATEMATICA COMPUTAZIONALE' 'LABORATORIO DI INTRODUZIONE ALLA MATEMATICA COMPUTAZIONALE'
) { ) {
evento.nome += ` (${i})` if (evento.docenti[0].nome === 'GIOVANNI') {
i++ 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 => const timetablesRaw = results.map(timetable =>
specialEventPatches(_.uniqBy(timetable, 'id')) specialEventPatches(_.uniqBy(timetable, 'id'))
) )
const allRaw = specialEventPatches(_.uniqBy(_.concat(...results), 'id')) const allRaw = specialEventPatches(_.concat(...results), 'id')
return { return {
'anno-1': formatEvents(timetablesRaw[0]), 'anno-1': formatEvents(timetablesRaw[0]),

@ -61,6 +61,7 @@ export function prettyCourseName(name) {
.replaceAll('IIi', 'III') .replaceAll('IIi', 'III')
.replaceAll('Iii', 'III') .replaceAll('Iii', 'III')
.replaceAll(/'(.)/g, ({}, letter) => "'" + letter.toUpperCase()) .replaceAll(/'(.)/g, ({}, letter) => "'" + letter.toUpperCase())
.replaceAll(/\((a|b)\)/g, ({}, letter) => "(" + letter.toUpperCase() + ")")
} }
export function prettyAulaName(name) { export function prettyAulaName(name) {

Loading…
Cancel
Save