utils/course_schedule library

Enums

CourseDateDirection

Extensions

PeriodScheduleTime on Period
Official NTUT class times for each Period.

Functions

adjacentCourseDate(CourseTableData courseTable, {required DateTime date, required CourseDateDirection direction, CourseScheduleDateRange? dateRange}) → DateTime?
Finds the nearest date with scheduled courses in direction.
courseMeetingEndPeriod({required Period startPeriod, required int span, required bool crossesNoon}) → Period
Returns the final period occupied by a merged course-table cell.
courseMeetingsForDate(CourseTableData courseTable, {required DateTime date, required DateTime now, CourseScheduleDateRange? dateRange}) → List<CourseScheduleMeeting>
Returns the scheduled meetings on date in chronological order.
nextCourseIndex(List<CourseScheduleMeeting> meetings, {required DateTime now}) → int?
Selects the first course that has not started yet.
nextCourseMeetingPosition(CourseTableData courseTable, {required DateTime now, CourseScheduleDateRange? dateRange}) → NextCourseMeetingPosition?
Finds the one scheduled course that occurs next relative to now.
ntutSemesterDateRange({required int year, required int term}) → CourseScheduleDateRange
Returns the approximate date range for an NTUT semester.
preferredTodayCourseIndex(List<CourseScheduleMeeting> meetings, {required DateTime now, Duration imminentThreshold = const Duration(minutes: 30)}) → int?
Selects the card that should receive focus on the home carousel.

Typedefs

CourseScheduleDateRange = ({DateTime end, DateTime start})
Inclusive start and exclusive end of a semester's approximate date range.
CourseScheduleMeeting = ({CourseTableCellData course, DateTime end, Period endPeriod, bool isOngoing, DateTime start, Period startPeriod})
One concrete occurrence of a course-table entry on the current date.
CourseScheduleTime = ({int hour, int minute})
A wall-clock time in the NTUT course schedule.
NextCourseMeetingPosition = ({DateTime date, int index})
The date and chronological index of the next scheduled course.