Skip to content

Commit

Permalink
Update sorting.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
akmazian committed Nov 14, 2023
1 parent aa58641 commit 91fa811
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/lib/courses/sorting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ type CompareFn = (courseA: CourseOverviewFragment, courseB: CourseOverviewFragme
* Comparator for department name. Essentially alphabetical order.
*/
export const compareDepartmentName: CompareFn = (courseA, courseB) => {
const courseATitle = `${courseA.abbreviation} ${courseA.courseNumber}`;
const courseBTitle = `${courseB.abbreviation} ${courseB.courseNumber}`;
const courseATitle = `${courseA.abbreviation} ${courseA.courseNumber.replace(/^[A-Za-z]/, '')}`;
const courseBTitle = `${courseB.abbreviation} ${courseB.courseNumber.replace(/^[A-Za-z]/, '')}`;
return courseATitle.localeCompare(courseBTitle);
};

Expand Down

0 comments on commit 91fa811

Please sign in to comment.