Compare commits

..

1 Commits

Author SHA1 Message Date
Francesco Minnocci 75af3ccd56 chore: update semester 4 months ago

Binary file not shown.

@ -11,15 +11,20 @@ import semesterData from './semester-data.json'
// MODE_SCHEDULE, // MODE_SCHEDULE,
// } from './components/EventsView.jsx' // } from './components/EventsView.jsx'
import { Courses } from './components/view/Courses.jsx'
import { Schedule } from './components/view/Schedule.jsx'
import { HamburgerMenu } from './components/HamburgerMenu.jsx' import { HamburgerMenu } from './components/HamburgerMenu.jsx'
import { Help } from './components/Help.jsx' import { Help } from './components/Help.jsx'
import { Icon } from './components/Icon.jsx' import { Icon } from './components/Icon.jsx'
import { OptionBar } from './components/OptionBar.jsx'
import { Popup } from './components/Popup.jsx' import { Popup } from './components/Popup.jsx'
import { Toolbar } from './components/Toolbar.jsx' import { Toolbar } from './components/Toolbar.jsx'
import { Courses } from './components/view/Courses.jsx' import { OptionBar } from './components/OptionBar.jsx'
import { Schedule } from './components/view/Schedule.jsx' import {
import { prettyAulaName, prettyProfName, usePersistentState } from './utils.jsx' prettyAulaName,
prettyProfName,
clearOldPersistentStates,
usePersistentState,
} from './utils.jsx'
import { SettingsBar } from './components/SettingsBar.jsx' import { SettingsBar } from './components/SettingsBar.jsx'
@ -45,8 +50,6 @@ const TIMETABLE_IDS = semesterData.timetableIds
function specialEventPatches(eventi) { function specialEventPatches(eventi) {
// Il laboratorio del primo anno in realtà è in due gruppi separati // Il laboratorio del primo anno in realtà è in due gruppi separati
eventi.forEach(evento => { eventi.forEach(evento => {
console.log(evento.id, evento.nome, evento.dataInizio, evento.dataFine)
if ( if (
evento.nome === 'LABORATORIO DI INTRODUZIONE ALLA MATEMATICA COMPUTAZIONALE' evento.nome === 'LABORATORIO DI INTRODUZIONE ALLA MATEMATICA COMPUTAZIONALE'
) { ) {
@ -110,7 +113,7 @@ async function loadCalendari(date) {
method: 'POST', method: 'POST',
mode: 'cors', mode: 'cors',
credentials: 'omit', credentials: 'omit',
}, }
) )
return await req.json() return await req.json()
@ -124,9 +127,9 @@ async function loadCalendari(date) {
] ]
const results = await Promise.all(requests) const results = await Promise.all(requests)
const timetablesRaw = results.map(timetable => const timetablesRaw = results.map(timetable =>
specialEventPatches(_.uniqBy(timetable, 'id')), specialEventPatches(_.uniqBy(timetable, 'id'))
) )
const allRaw = _.uniqBy(specialEventPatches(_.concat(...results)), 'id') const allRaw = specialEventPatches(_.concat(...results), 'id')
return { return {
'anno-1': formatEvents(timetablesRaw[0]), 'anno-1': formatEvents(timetablesRaw[0]),
@ -173,7 +176,7 @@ const App = ({}) => {
const [date, setDate] = useState(new Date().toISOString()) const [date, setDate] = useState(new Date().toISOString())
// Data Sources // Data Sources
const [view, setView] = usePersistentState('view', 'tutti') const [view, setView] = usePersistentState('view', 'magistrale')
const [timetables, setTimetables] = useState(null) const [timetables, setTimetables] = useState(null)
useEffect(async () => { useEffect(async () => {
setTimetables(await loadCalendari(new Date(date))) setTimetables(await loadCalendari(new Date(date)))
@ -191,7 +194,7 @@ const App = ({}) => {
const [theme, setTheme] = usePersistentState( const [theme, setTheme] = usePersistentState(
'theme', 'theme',
'light', 'light'
// window.matchMedia('(prefers-color-scheme: dark)').matches // window.matchMedia('(prefers-color-scheme: dark)').matches
// ? 'dark' // ? 'dark'
// : 'light' // : 'light'

@ -75,7 +75,7 @@ async function parseSemesterStartDate() {
try { try {
const { startYear, endYear } = getCurrentAcademicYear(); const { startYear, endYear } = getCurrentAcademicYear();
const currentMonth = new Date().getMonth(); const currentMonth = new Date().getMonth();
const currentSemester = currentMonth >= 0 && currentMonth <= 5 ? 2 : 1; const currentSemester = currentMonth >= 0 && currentMonth <= 6 ? 2 : 1;
const url = `https://www.dm.unipi.it/didattica/lezioni-esami/calendario-delle-attivita-didattiche/calendario-delle-attivita-didattiche-a-a-${startYear}-${endYear.toString().slice(-2)}/`; const url = `https://www.dm.unipi.it/didattica/lezioni-esami/calendario-delle-attivita-didattiche/calendario-delle-attivita-didattiche-a-a-${startYear}-${endYear.toString().slice(-2)}/`;

@ -8,7 +8,7 @@
"semesterStartDateStr": "25 febbraio 2026", "semesterStartDateStr": "25 febbraio 2026",
"firstMondayDate": "2026-03-02T00:00:00.000Z", "firstMondayDate": "2026-03-02T00:00:00.000Z",
"buttonText": "Vai al 2 marzo! 🚀", "buttonText": "Vai al 2 marzo! 🚀",
"lastUpdated": "2026-01-23T15:15:31.641Z", "lastUpdated": "2026-01-23T15:08:14.943Z",
"academicYear": { "academicYear": {
"startYear": 2025, "startYear": 2025,
"endYear": 2026 "endYear": 2026

Loading…
Cancel
Save