Browse Source

Add today indicator to route date chooser

master
Kenneth Bruen 1 year ago
parent
commit
4214fbbd45
Signed by: kbruen
GPG Key ID: C1980A470C3EE5B1
  1. 8
      route.js
  2. 2
      sw.js

8
route.js

@ -421,6 +421,14 @@ window.addEventListener('load', function (e) {
var innerPre = document.createElement('pre')
innerP.appendChild(innerPre)
innerPre.textContent = `${departureOption.getDate().toString().padStart(2, '0')}.${(departureOption.getMonth() + 1).toString().padStart(2, '0')}.${departureOption.getFullYear().toString().padStart(4, '0')}`
var departureOptionMidday = new Date(departureOption.getTime())
departureOptionMidday.setHours(12, 0, 0, 0)
var todayMidday = new Date()
todayMidday.setHours(12, 0, 0, 0)
if (departureOptionMidday.getTime() == todayMidday.getTime()) {
innerPre.textContent += ' (today)'
suggestionLi.focus()
}
}
document.querySelector('.csk').textContent = 'Select'

2
sw.js

@ -1,4 +1,4 @@
const VERSION = 'v35'
const VERSION = 'v36'
const API_ORIGIN = 'https://scraper.infotren.dcdev.ro/'
const API_TRAINS = `${API_ORIGIN}v3/trains`
const API_STATIONS = `${API_ORIGIN}v3/stations`

Loading…
Cancel
Save