fixed last week daily comsumption calcualtion error

This commit is contained in:
Yinyin Liu 2026-03-10 10:51:56 +01:00
parent f7ee347fc5
commit 0ac22ecbe9
1 changed files with 1 additions and 1 deletions

View File

@ -573,7 +573,7 @@ function WeeklySection({ installationId, latestMonthlyPeriodEnd }: { installatio
const prev = report.previousWeek; const prev = report.previousWeek;
const currentWeekDayCount = Math.min(7, report.dailyData.length); const currentWeekDayCount = Math.min(7, report.dailyData.length);
const previousWeekDayCount = Math.max(1, report.dailyData.length - currentWeekDayCount); const previousWeekDayCount = 7;
const formatChange = (pct: number) => const formatChange = (pct: number) =>
pct === 0 ? '—' : pct > 0 ? `+${pct.toFixed(1)}%` : `${pct.toFixed(1)}%`; pct === 0 ? '—' : pct > 0 ? `+${pct.toFixed(1)}%` : `${pct.toFixed(1)}%`;