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

@@ -108,7 +108,7 @@ WeatherProvider.register("weatherbit", {
const currentWeather = new WeatherObject(this.config.units, this.config.tempUnits, this.config.windUnits);
currentWeather.date = moment(currentWeatherData.data[0].ts, "X");
currentWeather.date = moment.unix(currentWeatherData.data[0].ts);
currentWeather.humidity = parseFloat(currentWeatherData.data[0].rh);
currentWeather.temperature = parseFloat(currentWeatherData.data[0].temp);
currentWeather.windSpeed = parseFloat(currentWeatherData.data[0].wind_spd);