mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
Show solar forecast even if no prod stats available (#9632)
This commit is contained in:
parent
4d330fba8a
commit
521d5df064
@ -261,10 +261,6 @@ export class HuiEnergySolarGraphCard
|
|||||||
const datasets: ChartDataset<"bar">[] = [];
|
const datasets: ChartDataset<"bar">[] = [];
|
||||||
let endTime: Date;
|
let endTime: Date;
|
||||||
|
|
||||||
if (statisticsData.length === 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
endTime = new Date(
|
endTime = new Date(
|
||||||
Math.max(
|
Math.max(
|
||||||
...statisticsData.map((stats) =>
|
...statisticsData.map((stats) =>
|
||||||
@ -273,7 +269,7 @@ export class HuiEnergySolarGraphCard
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (endTime > new Date()) {
|
if (!endTime || endTime > new Date()) {
|
||||||
endTime = new Date();
|
endTime = new Date();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user