mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
fix calculation of duration until next sunrise
This commit is contained in:
@@ -167,7 +167,7 @@ Module.register("clock",{
|
|||||||
} else if (now.isBefore(sunTimes.sunset)) {
|
} else if (now.isBefore(sunTimes.sunset)) {
|
||||||
nextEvent = sunTimes.sunset;
|
nextEvent = sunTimes.sunset;
|
||||||
} else {
|
} 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;
|
nextEvent = tomorrowSunTimes.sunrise;
|
||||||
}
|
}
|
||||||
const untilNextEvent = moment.duration(moment(nextEvent).diff(now));
|
const untilNextEvent = moment.duration(moment(nextEvent).diff(now));
|
||||||
|
Reference in New Issue
Block a user