From d6a6a5362338e15b84cc1cddb27b6fa29321083a Mon Sep 17 00:00:00 2001 From: fwitte Date: Thu, 14 Feb 2019 16:48:45 +0100 Subject: [PATCH] updated weather icon display --- modules/default/weather/providers/openweathermap.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/default/weather/providers/openweathermap.js b/modules/default/weather/providers/openweathermap.js index 9ae7cbd4..856a52c1 100644 --- a/modules/default/weather/providers/openweathermap.js +++ b/modules/default/weather/providers/openweathermap.js @@ -132,10 +132,14 @@ WeatherProvider.register("openweathermap", { // specify date weather.date = moment(forecast.dt, "X"); - // select weather type by first forecast value of a day, is this reasonable? + // If the first value of today is later than 17:00, we have an icon at least! weather.weatherType = this.convertWeatherType(forecast.weather[0].icon); } + + if (moment(forecast.dt, "X").format("H") >= 8 && moment(forecast.dt, "X").format("H") <= 17) { + weather.weatherType = this.convertWeatherType(forecast.weather[0].icon); + } // the same day as before // add values from forecast to corresponding variables