From 13ff0317e6297ed76240d42417ac178c71bf4054 Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Mon, 11 Aug 2025 22:35:03 -0500 Subject: [PATCH] fix nighttime icons on extended forecast close #134 --- server/scripts/modules/extendedforecast.mjs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/scripts/modules/extendedforecast.mjs b/server/scripts/modules/extendedforecast.mjs index c7fe98a..33537e4 100644 --- a/server/scripts/modules/extendedforecast.mjs +++ b/server/scripts/modules/extendedforecast.mjs @@ -137,10 +137,6 @@ const parse = (fullForecast, forecastUrl) => { } // get the object to modify/populate const fDay = forecast[destIndex]; - // high temperature will always be last in the source array so it will overwrite the low values assigned below - fDay.icon = getLargeIcon(period.icon); - fDay.text = shortenExtendedForecastText(period.shortForecast); - fDay.dayName = dates[destIndex]; // preload the icon preloadImg(fDay.icon); @@ -148,6 +144,9 @@ const parse = (fullForecast, forecastUrl) => { if (period.isDaytime) { // day time is the high temperature fDay.high = period.temperature; + fDay.icon = getLargeIcon(period.icon); + fDay.text = shortenExtendedForecastText(period.shortForecast); + fDay.dayName = dates[destIndex]; // Wait for the corresponding night period to increment } else { // low temperature