Indvidual Dashboard V0.9 #67
|
|
@ -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 recentNutr = (nutrition || []).filter(
|
||||
(n) => n.date >= dayjs().subtract(kcalWindowDays, 'day').format('YYYY-MM-DD'),
|
||||
})
|
||||
)
|
||||
const kcal =
|
||||
recentNutr.length > 0
|
||||
? Math.round(recentNutr.reduce((s, n) => s + (n.kcal || 0), 0) / recentNutr.length)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user