refactor(schedule): rename auxiliray def, more doc

This commit is contained in:
Sarah Vaupel 2021-05-06 14:57:06 +02:00
parent 8d06a035b1
commit 8ad6d5164c

View File

@ -160,7 +160,7 @@ weekSchedule now user@(Entity uid User{userScheduleWeekDays = ScheduleWeekDays u
ScheduleCourseEvent{..} -> goPrune sceNoOccur sceTerm sceOccurrence
ScheduleTutorial{..} -> goPrune stNoOccur stTerm stOccurrence
_ -> True
in sortOn (views _1 $ scheduleEntryToStart currentDay) $ filter (views _1 isRegularWithoutException) occurrencesInSlot
in sortOn (views _1 $ scheduleEntryStartUTC currentDay) $ filter (views _1 isRegularWithoutException) occurrencesInSlot
-- TODO: perform this filtering asap, in DB fetch if possible
events :: Map Day (Map TimeSlot [(ScheduleEntry, SlotAssociation)])
@ -224,8 +224,9 @@ scheduleEntryToHref = \case
ScheduleTutorial{stCourse=(Entity _ Course{..})} -> CourseR courseTerm courseSchool courseShorthand CShowR -- TODO: link to table with id "tutorials"?
ScheduleExamOccurrence{seoCourse=(Entity _ Course{..}),seoExamName} -> CExamR courseTerm courseSchool courseShorthand seoExamName EShowR
scheduleEntryToStart :: Day -> ScheduleEntry -> UTCTime
scheduleEntryToStart currentDay = \case
-- | At which UTCTime does a ScheduleEntry start, given a specific day?
scheduleEntryStartUTC :: Day -> ScheduleEntry -> UTCTime
scheduleEntryStartUTC currentDay = \case
ScheduleCourseEvent{sceOccurrence} -> occurrenceToStart sceOccurrence
ScheduleTutorial{stOccurrence} -> occurrenceToStart stOccurrence
ScheduleExamOccurrence{seoStart} -> seoStart