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