|
|
|
@ -285,7 +285,7 @@ function onTrainData(data, fetchDate) {
|
|
|
|
|
|
|
|
|
|
var originalArr = document.createElement('p') |
|
|
|
|
stationArrival.appendChild(originalArr) |
|
|
|
|
var originalArrSpan = document.createElement('span') |
|
|
|
|
var originalArrSpan = document.createElement('pre') |
|
|
|
|
originalArr.appendChild(originalArrSpan) |
|
|
|
|
var arrDate = new Date(station.arrival.scheduleTime) |
|
|
|
|
originalArrSpan.textContent = arrDate.toLocaleTimeString([], { 'hour': '2-digit', 'minute': '2-digit' }) |
|
|
|
@ -303,11 +303,13 @@ function onTrainData(data, fetchDate) {
|
|
|
|
|
var actualArr = document.createElement('p') |
|
|
|
|
stationArrival.appendChild(actualArr) |
|
|
|
|
arrDate.setMinutes(arrDate.getMinutes() + station.arrival.status.delay) |
|
|
|
|
actualArr.textContent = arrDate.toLocaleTimeString([], { 'hour': '2-digit', 'minute': '2-digit' }) |
|
|
|
|
actualArr.classList.add('pri', station.arrival.status.delay > 0 ? 'late' : 'early') |
|
|
|
|
if (!station.arrival.status.real) { |
|
|
|
|
actualArr.classList.add('not-real') |
|
|
|
|
} |
|
|
|
|
var actualArrPre = document.createElement('pre') |
|
|
|
|
actualArr.appendChild(actualArrPre) |
|
|
|
|
actualArrPre.textContent = arrDate.toLocaleTimeString([], { 'hour': '2-digit', 'minute': '2-digit' }) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -319,7 +321,7 @@ function onTrainData(data, fetchDate) {
|
|
|
|
|
var originalDep = document.createElement('p') |
|
|
|
|
stationDeparture.appendChild(originalDep) |
|
|
|
|
var depDate = new Date(station.departure.scheduleTime) |
|
|
|
|
var originalDepSpan = document.createElement('span') |
|
|
|
|
var originalDepSpan = document.createElement('pre') |
|
|
|
|
originalDep.appendChild(originalDepSpan) |
|
|
|
|
originalDepSpan.textContent = depDate.toLocaleTimeString([], { 'hour': '2-digit', 'minute': '2-digit' }) |
|
|
|
|
originalDep.classList.add('pri') |
|
|
|
@ -336,11 +338,13 @@ function onTrainData(data, fetchDate) {
|
|
|
|
|
var actualDep = document.createElement('p') |
|
|
|
|
stationDeparture.appendChild(actualDep) |
|
|
|
|
depDate.setMinutes(depDate.getMinutes() + station.departure.status.delay) |
|
|
|
|
actualDep.textContent = depDate.toLocaleTimeString([], { 'hour': '2-digit', 'minute': '2-digit' }) |
|
|
|
|
actualDep.classList.add('pri', station.departure.status.delay > 0 ? 'late' : 'early') |
|
|
|
|
if (!station.departure.status.real) { |
|
|
|
|
actualDep.classList.add('not-real') |
|
|
|
|
} |
|
|
|
|
var actualDepPre = document.createElement('pre') |
|
|
|
|
actualDep.appendChild(actualDepPre) |
|
|
|
|
actualDepPre.textContent = depDate.toLocaleTimeString([], { 'hour': '2-digit', 'minute': '2-digit' }) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|