Skip to content

Commit

Permalink
format and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
egsch committed Nov 25, 2024
1 parent 633590e commit a85d201
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/components/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import tutorial2 from 'data-base64:../../assets/tutorial2.png';
import React, { useEffect, useState } from 'react';

import { TRENDS_URL } from '~data/config';
import { addGoogleOAuth } from '~popup';

const STORAGE_KEY = 'page';

Expand Down
20 changes: 13 additions & 7 deletions src/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,30 +147,36 @@ export async function scrapeCourseData() {
const semester = semesters.S25;

// parse
let days = times.split(" ")[0].replace("M", "MO,").replace("W", "WE,").replace("F", "FR,").replace("Th", "TH,").replace("T", "TU,");
let days = times
.split(' ')[0]
.replace('M', 'MO,')
.replace('W', 'WE,')
.replace('F', 'FR,')
.replace('Th', 'TH,')
.replace('T', 'TU,');
if (days[days.length - 1] == ',') {
days = days.slice(0, days.length - 1);
}

let day1 = semester.firstMondayOfSemester;
switch(days.slice(0, 2)) {
case "MO": {
switch (days.slice(0, 2)) {
case 'MO': {
day1 = semester.firstMondayOfSemester;
break;
}
case "TU": {
case 'TU': {
day1 = semester.firstMondayOfSemester + 1;
break;
}
case "WE": {
case 'WE': {
day1 = semester.firstMondayOfSemester + 2;
break;
}
case "TH": {
case 'TH': {
day1 = semester.firstMondayOfSemester + 2;
break;
}
case "FR": {
case 'FR': {
day1 = semester.firstMondayOfSemester + 4;
break;
}
Expand Down

0 comments on commit a85d201

Please sign in to comment.