first brutal rework and first prototype

This commit is contained in:
2023-08-19 03:57:46 +02:00
parent 04b6d5640d
commit a34d36257b
11 changed files with 289 additions and 313 deletions
+3 -2
View File
@@ -2,10 +2,11 @@ import { format } from 'date-fns'
import _ from 'lodash'
import { prettyCourseName, WEEK_DAYS, withClasses } from '../../utils.jsx'
export const Schedule = ({ events, selection, setSelection, hideOtherCourses }) => {
export const Schedule = ({ timetables, selection, setSelection }) => {
const events = timetables['tutti']
const selectionSet = new Set(selection)
const visibleEvents = !hideOtherCourses ? events : events.filter(e => selectionSet.has(e.id))
const visibleEvents = events.filter(e => selectionSet.has(e.id))
const eventsByWeekday = _.mapValues(
_.groupBy(visibleEvents, e => e.start.getDay()),