From 9cffa3dd676ec2e978bdf1d1ba2e51dd96055df4 Mon Sep 17 00:00:00 2001 From: Denis Treskunov Date: Sat, 18 Jan 2020 17:01:26 -0800 Subject: [PATCH] fix calculation of duration until next sunrise --- modules/default/clock/clock.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/clock/clock.js b/modules/default/clock/clock.js index e6ac880b..96c31143 100644 --- a/modules/default/clock/clock.js +++ b/modules/default/clock/clock.js @@ -167,7 +167,7 @@ Module.register("clock",{ } else if (now.isBefore(sunTimes.sunset)) { nextEvent = sunTimes.sunset; } else { - const tomorrowSunTimes = SunCalc.getTimes(now.add(1, 'day'), this.config.lat, this.config.lon); + const tomorrowSunTimes = SunCalc.getTimes(now.clone().add(1, 'day'), this.config.lat, this.config.lon); nextEvent = tomorrowSunTimes.sunrise; } const untilNextEvent = moment.duration(moment(nextEvent).diff(now));