Skip to content

Commit

Permalink
Meeting Day, Meeting Time -> Meeting Patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
SophiaSun18 committed Mar 11, 2024
1 parent 7f51ba2 commit 7d7cd72
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions client-course-schedulizer/src/utilities/helpers/caseFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { cloneDeep, forEach } from "lodash";
import moment from "moment";
import { Case } from "runtypes";
import { emptyMeeting } from "utilities/constants";
import { Course, Day, Meeting, Section, SemesterLength, Term } from "utilities/interfaces";

Expand Down Expand Up @@ -233,6 +234,15 @@ export const sectionCallback = (value: string, params: CaseCallbackParams) => {
}
};

export const meetingPatternCallback = (value: string, params: CaseCallbackParams) => {
const meetingDays = value.split("|")[0];
const startTime = value.split(" ")[2];
const endTime = value.split(" ")[4];

daysCallback(meetingDays, params);
timeCallback(startTime + " - " + endTime, params);
}

export const timeCallback = (value: string, params: CaseCallbackParams) => {
const [startTime] = value.split(" ").join("").split("-");
startTimeCallback(startTime, params);
Expand Down
3 changes: 2 additions & 1 deletion client-course-schedulizer/src/utilities/helpers/readCSV.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ const registrarSpreadsheetFields: ValidFields = {
Instructors: cf.instructorCallback,
LastEditTimestamp: cf.timestampCallback,
Location1: cf.locationCallback,
Location2: cf.locationCallback,
// Location2: cf.locationCallback,
// LocalMax: cf.localMaxCallback,
MeetingDays: cf.daysCallback,
MeetingDurationMinutes: cf.durationCallback,
MeetingPatterns: cf.meetingPatternCallback,
MeetingStart: cf.startTimeCallback,
MeetingTime: cf.timeCallback,
MinimumCredits: cf.studentHoursCallback,
Expand Down

0 comments on commit 7d7cd72

Please sign in to comment.