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

feat(download.ts): add location attribute to custom events #1004

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/antalmanac/src/lib/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { notNull } from './utils';
import { openSnackbar } from '$actions/AppStoreActions';
import { CustomEvent, FinalExam } from '$components/Calendar/CourseCalendarEvent';
import analyticsEnum, { logAnalytics } from '$lib/analytics';
import buildingCatalogue from '$lib/buildingCatalogue';
import { getDefaultTerm, termData } from '$lib/termData';
import AppStore from '$stores/AppStore';

Expand Down Expand Up @@ -261,7 +262,7 @@ export function getEventsFromCourses(
if (event.isCustomEvent) {
// FIXME: We don't have a way to get the term for custom events,
// so we just use the default term.
const { title, start, end } = event as CustomEvent;
const { title, start, end, building } = event as CustomEvent;
const days = getByDays(event.days.join(''));
const rrule = getRRule(days, getQuarter(term));
const eventStartDate = getClassStartDate(term, days);
Expand All @@ -275,8 +276,7 @@ export function getEventsFromCourses(
startOutputType: 'local' as const,
endOutputType: 'local' as const,
title: title,
// TODO: Add location to custom events, waiting for https://github.com/icssc/AntAlmanac/issues/249
// location: `${location.building} ${location.room}`,
location: buildingCatalogue[Number(building)].name,
start: firstClassStart,
end: firstClassEnd,
recurrenceRule: rrule,
Expand Down
Loading