mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 20:22:53 +00:00
Merge pull request #1887 from dtreskunov/dtreskunov/sun-and-moon
fix calculation of duration until next sunrise
This commit is contained in:
commit
9f4dc1e382
@ -15,7 +15,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
### Added
|
### Added
|
||||||
- Finnish translation for "PRECIP", "UPDATE_INFO_MULTIPLE" and "UPDATE_INFO_SINGLE".
|
- Finnish translation for "PRECIP", "UPDATE_INFO_MULTIPLE" and "UPDATE_INFO_SINGLE".
|
||||||
- Added the ability to hide the temp label and weather icon in the `currentweather` module to allow showing only information such as wind and sunset/rise.
|
- Added the ability to hide the temp label and weather icon in the `currentweather` module to allow showing only information such as wind and sunset/rise.
|
||||||
- Sun and Moon data to the `clock` module.
|
- The `clock` module now optionally displays sun and moon data, including rise/set times, remaining daylight, and percent of moon illumination.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Force declaration of public ip adress in config file (ISSUE #1852)
|
- Force declaration of public ip adress in config file (ISSUE #1852)
|
||||||
|
@ -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));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user