Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ics calendar export dates #535

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Samathingamajig
Copy link
Collaborator

@Samathingamajig Samathingamajig commented Feb 28, 2025

Now will export classes based on the academic calendar. Allows for skipping holidays and multi-day breaks. Accounts for semesters by using the semester info on the course itself, so it's legal to have a schedule with multiple semesters (though, that should be prevented in general, but that will be a separate PR).

Drawbacks: Doesn't support winter terms or any of the various summer terms, except it interprets all summer courses as full-term summer courses.

image
image
image


This change is Reviewable

Copy link
Collaborator

@doprz doprz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. Requested some minor changes in addition that this requires further testing.

'2028-07-04', // Independence Day holiday
],
},
} as const satisfies Partial<Record<SemesterIdentifier, AcademicCalendarSemester>>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +1 to +7
type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
type Year = `20${Digit}${Digit}`;
type Month = `0${Exclude<Digit, 0>}` | `1${'0' | '1' | '2'}`;
type Day = `0${Exclude<Digit, 0>}` | `${1 | 2}${Digit}` | '30' | '31';
type DateStr = `${Year}-${Month}-${Day}`;
type SemesterDigit = 2 | 6 | 9;
type SemesterIdentifier = `20${Digit}${Digit}${SemesterDigit}`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good use of Template Literal Types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save as .CAL export feature should begin on first class day and end on last class day
2 participants