Fix chart labels for multi year periods (#25572)

This commit is contained in:
Petar Petrov 2025-05-23 13:08:22 +03:00 committed by GitHub
parent c11d2c10df
commit 9b8be9f1af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -387,9 +387,9 @@ export class HaChartBase extends LitElement {
if (axis.type !== "time" || axis.show === false) { if (axis.type !== "time" || axis.show === false) {
return axis; return axis;
} }
if (axis.max && axis.min) { if (axis.min) {
this._minutesDifference = differenceInMinutes( this._minutesDifference = differenceInMinutes(
axis.max as Date, (axis.max as Date) || new Date(),
axis.min as Date axis.min as Date
); );
} }