Convert moment(..., "X") to moment.unix(...) (#2950)

because I thought it was more readable and I found a little bug when
calculatin suntimes on the way....

Co-authored-by: veeck <michael@veeck.de>
This commit is contained in:
Veeck
2022-10-16 23:37:50 +02:00
committed by GitHub
parent 835c893205
commit fc59ed20e3
7 changed files with 26 additions and 26 deletions

View File

@@ -143,8 +143,8 @@ class WeatherObject {
updateSunTime(lat, lon) {
const now = !this.date ? new Date() : this.date.toDate();
const times = SunCalc.getTimes(now, lat, lon);
this.sunrise = moment(times.sunrise, "X");
this.sunset = moment(times.sunset, "X");
this.sunrise = moment(times.sunrise);
this.sunset = moment(times.sunset);
}
/**