first brutal rework and first prototype
This commit is contained in:
@@ -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()),
|
||||
|
||||
Reference in New Issue
Block a user