mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Fix error in reduceSumStatisticsByDay
(#10170)
This commit is contained in:
parent
910cd98a38
commit
85956dc7fd
@ -490,7 +490,7 @@ export const reduceSumStatisticsByDay = (
|
|||||||
// add init value if the first value isn't end of previous period
|
// add init value if the first value isn't end of previous period
|
||||||
result.push({
|
result.push({
|
||||||
...values[0]!,
|
...values[0]!,
|
||||||
start: startOfMonth(addDays(new Date(values[0].start), -1)).toISOString(),
|
start: startOfDay(addDays(new Date(values[0].start), -1)).toISOString(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
let lastValue: StatisticValue;
|
let lastValue: StatisticValue;
|
||||||
@ -546,7 +546,7 @@ export const reduceSumStatisticsByMonth = (
|
|||||||
prevMonth = month;
|
prevMonth = month;
|
||||||
}
|
}
|
||||||
if (prevMonth !== month) {
|
if (prevMonth !== month) {
|
||||||
// Last value of the day
|
// Last value of the month
|
||||||
result.push({
|
result.push({
|
||||||
...lastValue!,
|
...lastValue!,
|
||||||
start: startOfMonth(new Date(lastValue!.start)).toISOString(),
|
start: startOfMonth(new Date(lastValue!.start)).toISOString(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user