icssc / AntAlmanac

A course exploration and scheduling tool for UCI Anteaters
https://antalmanac.com
MIT License
54 stars 64 forks source link

Display Finals Date From Default Term #881

Closed adcockdalton closed 6 months ago

adcockdalton commented 6 months ago

Summary

  1. Added new optional field to TermData.ts "finalsStartDate"
  2. Changed calendarizeFinals to correctly assign finals to their respective dates instead of the arbitrary (2018, 0, 1)
  3. Refactored CalendarRoot to use date instead of defaultDate
  4. Dynamically update date

Regular classes still populate to the arbitrary 2018 date, which is simpler since those are displayed dateless. All other data relies on the finalsStartDate field specified by defaultTerm.

Test Plan

  1. Make a schedule with classes that have different finals, toggle back and forth.
  2. Try with only Saturday finals classes (Math 2b) or a mix of each (any class and Math 2b), etc.

Issues

Closes #758

Future Followup

Make an alternate to hardcoding future dates (#778) including for finals, or at least hardcode the next few years.