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 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)
|
||||||
|
|||||||
Reference in new issue
Block a user