cleaned up code

This commit is contained in:
Sriram Hariharan
2019-08-11 10:09:59 -05:00
parent e877ecaa6b
commit 893e882377
9 changed files with 127 additions and 142 deletions

View File

@@ -144,8 +144,6 @@ function buildTimeTitle(times) {
return lines
}
function makeLine(date, time, place) {
var arr = seperateDays(date)
var output = prettifyDaysText(arr)
@@ -154,28 +152,6 @@ function makeLine(date, time, place) {
return `${output} at ${time.replace(/\./g, '').replace(/\-/g, ' to ')} in <a style='font-size:medium' target='_blank' href='https://maps.utexas.edu/buildings/UTM/${building}'>${building}</>`;
}
function prettifyDaysText(arr) {
var output = "";
if (arr.length > 2) {
for (var i = 0; i < arr.length; i++) {
if (i < arr.length - 1)
output += arr[i] + ", "
if (i == arr.length - 2)
output += "and ";
if (i == arr.length - 1)
output += arr[i];
}
} else if (arr.length == 2) {
output = arr[0] + " and " + arr[1];
} else {
output = arr[0];
}
return output
}
function setChart(data) {
//set up the chart
toggleChartLoading(false);