Skip to content

Commit

Permalink
Handle cases where there is no - Internet/Online postfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyaointl committed Jan 16, 2021
1 parent e9ffd31 commit 132b96b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ function parseTable(table) {
let startTime, endTime
try {
let target = cols[colIndex('Day(s) & Location(s)')].firstElementChild.firstElementChild.firstElementChild.innerHTML
let matches = [...target.matchAll(/> (.*) - (.*) -/g)][0]
target = target.replace(' - Internet/Online', '')
let matches = [...target.matchAll(/> (.*) - (.*)$/g)][0]
startTime = matches[1], endTime = matches[2]
} catch (error) {
console.warn("Cannot find times for " + name + ". Does this class have missing fields?")
Expand Down

0 comments on commit 132b96b

Please sign in to comment.