Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #69 from yuri-vashchenko/master
Browse files Browse the repository at this point in the history
fix mode detection for hourly forecast
  • Loading branch information
Yevgenium authored Aug 29, 2021
2 parents 366ef1e + 855fe77 commit 2a730fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class WeatherChartCard extends LitElement {
var lengthUnit = this._hass.config.unit_system.length;
var precipUnit = lengthUnit === 'km' ? this.ll('uPrecip')[0] : this.ll('uPrecip')[1];
var forecast = weather.attributes.forecast.slice(0, forecastItems);
if (new Date(forecast[1].datetime) - new Date(forecast[0].datetime) === 36e5)
if ((new Date(forecast[1].datetime) - new Date(forecast[0].datetime)) < 864e5)
var mode = 'hourly';
else
var mode = 'daily';
Expand Down

0 comments on commit 2a730fa

Please sign in to comment.