Indvidual Dashboard V0.9 #67

Merged
Lars merged 27 commits from develop into main 2026-04-08 10:56:02 +02:00
Showing only changes of commit 096d896166 - Show all commits

View File

@ -44,7 +44,7 @@ export default function PilotKpiBoard({ refreshTick = 0, kcalWindowDays = KPI_KC
const latestCal = Array.isArray(calipers) && calipers[0]?.body_fat_pct != null ? calipers[0] : null const latestCal = Array.isArray(calipers) && calipers[0]?.body_fat_pct != null ? calipers[0] : null
const recentNutr = (nutrition || []).filter( const recentNutr = (nutrition || []).filter(
(n) => n.date >= dayjs().subtract(kcalWindowDays, 'day').format('YYYY-MM-DD'), (n) => n.date >= dayjs().subtract(kcalWindowDays, 'day').format('YYYY-MM-DD'),
}) )
const kcal = const kcal =
recentNutr.length > 0 recentNutr.length > 0
? Math.round(recentNutr.reduce((s, n) => s + (n.kcal || 0), 0) / recentNutr.length) ? Math.round(recentNutr.reduce((s, n) => s + (n.kcal || 0), 0) / recentNutr.length)