|
|
@ -130,7 +130,7 @@ function onTrainData(data) { |
|
|
|
var originalArr = document.createElement('p') |
|
|
|
var originalArr = document.createElement('p') |
|
|
|
stationArrival.appendChild(originalArr) |
|
|
|
stationArrival.appendChild(originalArr) |
|
|
|
var arrDate = new Date(station.arrival.scheduleTime) |
|
|
|
var arrDate = new Date(station.arrival.scheduleTime) |
|
|
|
originalArr.textContent = `${arrDate.getHours().toString().padStart(2, "0")}:${arrDate.getMinutes().toString().padStart(2, "0")}` |
|
|
|
originalArr.textContent = arrDate.toLocaleTimeString([], { 'hour': '2-digit', 'minute': '2-digit' }) |
|
|
|
originalArr.classList.add('pri') |
|
|
|
originalArr.classList.add('pri') |
|
|
|
if (station.arrival.status && station.arrival.status.delay != 0) { |
|
|
|
if (station.arrival.status && station.arrival.status.delay != 0) { |
|
|
|
originalArr.classList.remove('pri') |
|
|
|
originalArr.classList.remove('pri') |
|
|
@ -139,7 +139,7 @@ function onTrainData(data) { |
|
|
|
var actualArr = document.createElement('p') |
|
|
|
var actualArr = document.createElement('p') |
|
|
|
stationArrival.appendChild(actualArr) |
|
|
|
stationArrival.appendChild(actualArr) |
|
|
|
arrDate.setMinutes(arrDate.getMinutes() + station.arrival.status.delay) |
|
|
|
arrDate.setMinutes(arrDate.getMinutes() + station.arrival.status.delay) |
|
|
|
actualArr.textContent = `${arrDate.getHours().toString().padStart(2, "0")}:${arrDate.getMinutes().toString().padStart(2, "0")}` |
|
|
|
actualArr.textContent = arrDate.toLocaleTimeString([], { 'hour': '2-digit', 'minute': '2-digit' }) |
|
|
|
actualArr.classList.add('pri', station.arrival.status.delay > 0 ? 'late' : 'early') |
|
|
|
actualArr.classList.add('pri', station.arrival.status.delay > 0 ? 'late' : 'early') |
|
|
|
if (!station.arrival.status.real) { |
|
|
|
if (!station.arrival.status.real) { |
|
|
|
actualArr.classList.add('not-real') |
|
|
|
actualArr.classList.add('not-real') |
|
|
@ -155,7 +155,7 @@ function onTrainData(data) { |
|
|
|
var originalDep = document.createElement('p') |
|
|
|
var originalDep = document.createElement('p') |
|
|
|
stationDeparture.appendChild(originalDep) |
|
|
|
stationDeparture.appendChild(originalDep) |
|
|
|
var depDate = new Date(station.departure.scheduleTime) |
|
|
|
var depDate = new Date(station.departure.scheduleTime) |
|
|
|
originalDep.textContent = `${depDate.getHours().toString().padStart(2, "0")}:${depDate.getMinutes().toString().padStart(2, "0")}` |
|
|
|
originalDep.textContent = depDate.toLocaleTimeString([], { 'hour': '2-digit', 'minute': '2-digit' }) |
|
|
|
originalDep.classList.add('pri') |
|
|
|
originalDep.classList.add('pri') |
|
|
|
if (station.departure.status && station.departure.status.delay != 0) { |
|
|
|
if (station.departure.status && station.departure.status.delay != 0) { |
|
|
|
originalDep.classList.remove('pri') |
|
|
|
originalDep.classList.remove('pri') |
|
|
@ -164,7 +164,7 @@ function onTrainData(data) { |
|
|
|
var actualDep = document.createElement('p') |
|
|
|
var actualDep = document.createElement('p') |
|
|
|
stationDeparture.appendChild(actualDep) |
|
|
|
stationDeparture.appendChild(actualDep) |
|
|
|
depDate.setMinutes(depDate.getMinutes() + station.departure.status.delay) |
|
|
|
depDate.setMinutes(depDate.getMinutes() + station.departure.status.delay) |
|
|
|
actualDep.textContent = `${depDate.getHours().toString().padStart(2, "0")}:${depDate.getMinutes().toString().padStart(2, "0")}` |
|
|
|
actualDep.textContent = depDate.toLocaleTimeString([], { 'hour': '2-digit', 'minute': '2-digit' }) |
|
|
|
actualDep.classList.add('pri', station.departure.status.delay > 0 ? 'late' : 'early') |
|
|
|
actualDep.classList.add('pri', station.departure.status.delay > 0 ? 'late' : 'early') |
|
|
|
if (!station.departure.status.real) { |
|
|
|
if (!station.departure.status.real) { |
|
|
|
actualDep.classList.add('not-real') |
|
|
|
actualDep.classList.add('not-real') |
|
|
|