cleaned up code
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user