mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-22 05:07:05 +00:00
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:
@@ -81,8 +81,8 @@ WeatherProvider.register("darksky", {
|
||||
currentWeather.windSpeed = parseFloat(currentWeatherData.currently.windSpeed);
|
||||
currentWeather.windDirection = currentWeatherData.currently.windBearing;
|
||||
currentWeather.weatherType = this.convertWeatherType(currentWeatherData.currently.icon);
|
||||
currentWeather.sunrise = moment(currentWeatherData.daily.data[0].sunriseTime, "X");
|
||||
currentWeather.sunset = moment(currentWeatherData.daily.data[0].sunsetTime, "X");
|
||||
currentWeather.sunrise = moment.unix(currentWeatherData.daily.data[0].sunriseTime);
|
||||
currentWeather.sunset = moment.unix(currentWeatherData.daily.data[0].sunsetTime);
|
||||
|
||||
return currentWeather;
|
||||
},
|
||||
@@ -93,7 +93,7 @@ WeatherProvider.register("darksky", {
|
||||
for (const forecast of forecasts) {
|
||||
const weather = new WeatherObject(this.config.units, this.config.tempUnits, this.config.windUnits, this.config.useKmh);
|
||||
|
||||
weather.date = moment(forecast.time, "X");
|
||||
weather.date = moment.unix(forecast.time);
|
||||
weather.minTemperature = forecast.temperatureMin;
|
||||
weather.maxTemperature = forecast.temperatureMax;
|
||||
weather.weatherType = this.convertWeatherType(forecast.icon);
|
||||
|
Reference in New Issue
Block a user