fix day 0 insight main dashboard page

This commit is contained in:
Alberto-Audrix committed 2026-10-01 15:55:09 +07:00
1 parent e1987d6999
commit bc2b260065
6 files changed
+165 -36

No files matched your search

+1
View File
@@ -61,6 +61,7 @@ function pickStandardValues(docWeight: number): number[] {
/** Target body weight (grams) for a given age from the Ross 308 DOC-weight table. */
export function getTargetWeightForAge(age: number, docWeight: number): number | null {
if (age === 0) return docWeight > 0 ? docWeight : null;
const values = pickStandardValues(docWeight);
if (age < 1 || age > values.length) return null;
return values[age - 1] ?? null;