Skip to content

Commit

Permalink
SunCalc provides a date object, not just a unix timestamp
Browse files Browse the repository at this point in the history
therefore we dont need this explicit formatting
  • Loading branch information
veeck authored and rejas committed Aug 6, 2022
1 parent 00cdb76 commit 797e45d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/default/weather/weatherobject.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,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.unix(times.sunrise);
this.sunset = moment.unix(times.sunset);
this.sunrise = moment(times.sunrise);
this.sunset = moment(times.sunset);
}

/**
Expand Down

0 comments on commit 797e45d

Please sign in to comment.