From c748f117c3b27d4bf9bc189f7e78367aba08d54b Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Tue, 11 Oct 2022 03:23:01 +0300 Subject: [PATCH] Fix bug in yesterday date computation --- sw.js | 2 +- view-train.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sw.js b/sw.js index 972a011..bab2937 100755 --- a/sw.js +++ b/sw.js @@ -1,4 +1,4 @@ -const VERSION = 'v12' +const VERSION = 'v13' const API_ORIGIN = 'https://scraper.infotren.dcdev.ro/' const API_TRAINS = `${API_ORIGIN}v3/trains` const API_STATIONS = `${API_ORIGIN}v3/stations` diff --git a/view-train.js b/view-train.js index 92a2eb3..335d893 100755 --- a/view-train.js +++ b/view-train.js @@ -346,7 +346,7 @@ function refresh() { /** * @type {Date} */ - var reqDate = date + var reqDate = new Date(date.valueOf()) if (yesterday) { reqDate.setDate(reqDate.getDate() - 1) }