Fix bug in yesterday date computation

This commit is contained in:
Kenneth Bruen 2022-10-11 03:23:01 +03:00
parent 7bd7b26256
commit c748f117c3
Signed by: kbruen
GPG key ID: C1980A470C3EE5B1
2 changed files with 2 additions and 2 deletions

2
sw.js
View file

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

View file

@ -346,7 +346,7 @@ function refresh() {
/** /**
* @type {Date} * @type {Date}
*/ */
var reqDate = date var reqDate = new Date(date.valueOf())
if (yesterday) { if (yesterday) {
reqDate.setDate(reqDate.getDate() - 1) reqDate.setDate(reqDate.getDate() - 1)
} }