From e98489385363ce9d905f1cb3e7ffd846be532022 Mon Sep 17 00:00:00 2001 From: Ashish Tank Date: Wed, 9 Dec 2020 11:58:47 +0100 Subject: [PATCH] Issue #2221 - Night icons are always shown for locale other then english --- modules/default/weatherforecast/weatherforecast.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 4ecc18aa..d797625c 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -371,7 +371,7 @@ Module.register("weatherforecast", { var hour; if (forecast.dt_txt) { day = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("ddd"); - hour = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("H"); + hour = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").toDate().getHours(); } else { day = moment(forecast.dt, "X").format("ddd"); hour = moment(forecast.dt, "X").format("H"); @@ -385,7 +385,6 @@ Module.register("weatherforecast", { minTemp: this.roundValue(forecast.temp.min), rain: this.processRain(forecast, forecastList) }; - this.forecast.push(forecastData); lastDay = day;