From 6673631e47a9a6ae8ff7f5f81246af16b00fd9ae Mon Sep 17 00:00:00 2001 From: optama Date: Thu, 7 May 2020 20:50:13 +0200 Subject: [PATCH] #5761 fix weather forecast card showing hours instead of weekdays --- src/panels/lovelace/cards/hui-weather-forecast-card.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/panels/lovelace/cards/hui-weather-forecast-card.ts b/src/panels/lovelace/cards/hui-weather-forecast-card.ts index 1909c704dde3..2d9adf3356c3 100644 --- a/src/panels/lovelace/cards/hui-weather-forecast-card.ts +++ b/src/panels/lovelace/cards/hui-weather-forecast-card.ts @@ -150,9 +150,9 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard { let hourly: boolean | undefined; - if (forecast?.length && forecast?.length > 1) { - const date1 = new Date(forecast[0].datetime); - const date2 = new Date(forecast[1].datetime); + if (forecast?.length && forecast?.length > 2) { + const date1 = new Date(forecast[1].datetime); + const date2 = new Date(forecast[2].datetime); const timeDiff = date2.getTime() - date1.getTime(); hourly = timeDiff < DAY_IN_MILLISECONDS;