|
|
|
@ -190,7 +190,7 @@ function onTrainData(data) {
|
|
|
|
|
|
|
|
|
|
var refreshStopToken = null |
|
|
|
|
function refresh() { |
|
|
|
|
fetch(`https://scraper.infotren.dcdev.ro/v2/train/${trainNumber}?date=${date.toISOString()}`) |
|
|
|
|
fetch(`https://scraper.infotren.dcdev.ro/v2/train/${trainNumber}?date=${date.getFullYear().toString()}-${(date.getMonth() + 1).toString().padStart(2, "0")}-${date.getDate().toString().padStart(2, "0")}`) |
|
|
|
|
.then(function (response) { |
|
|
|
|
return response.json() |
|
|
|
|
}) |
|
|
|
@ -263,6 +263,14 @@ window.addEventListener('load', function (e) {
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
break |
|
|
|
|
case '1': |
|
|
|
|
date.setDate(date.getDate() - 1) |
|
|
|
|
refresh() |
|
|
|
|
break |
|
|
|
|
case '3': |
|
|
|
|
date.setDate(date.getDate() + 1) |
|
|
|
|
refresh() |
|
|
|
|
break |
|
|
|
|
default: |
|
|
|
|
console.log(e.key) |
|
|
|
|
} |
|
|
|
|