Write "?" when no sun progress data is available

master
Marco Heiming 2022-01-15 10:41:50 +01:00
parent ee7497b45c
commit a539325f7a
1 changed files with 1 additions and 1 deletions

View File

@ -324,12 +324,12 @@ function drawSunProgress(w) {
icon = sunSetDown;
}
let text = "?";
const times = getSunData();
if (times != undefined) {
const sunRise = Math.round(times.sunrise.getTime() / 1000);
const sunSet = Math.round(times.sunset.getTime() / 1000);
const now = Math.round(new Date().getTime() / 1000);
let text;
if (now > sunRise && now < sunSet) {
text = formatSeconds(sunSet - now);
} else {