fix hitung ayam dan karung data yang ditampilkan melebihi estimasi panen
CI / lint-and-test (push) Canceled after 0s

This commit is contained in:
Alberto-Audrix committed 2026-07-29 10:48:03 +07:00
1 parent 32a36cceff
commit b6117ae7d5
8 files changed
+105 -49

No files matched your search

+7 -2
View File
@@ -200,7 +200,9 @@ const DataManagementPage: React.FC<DataManagementPageProps> = ({ selectedKandang
const diffMs = todayMs - startDateMs;
const actualCurrentDay = diffMs >= 0 ? Math.floor(diffMs / (1000 * 60 * 60 * 24)) : 0;
const maxDay = cycleData.currentDay;
// Last inclusive 0-based day index matches Estimasi Panen (startDate + totalDays - 1)
const lastCycleDay = Math.max(0, (cycleData.totalDays || 1) - 1);
const maxDay = Math.min(cycleData.currentDay ?? 0, lastCycleDay);
// Fetch chicken counting data
const chickenCountMap: Record<number, number> = {};
@@ -249,6 +251,7 @@ const DataManagementPage: React.FC<DataManagementPageProps> = ({ selectedKandang
cycleData.id,
cycleData.startDate,
cycleData.currentDay,
cycleData.totalDays,
selectedKandangId,
initialPopulation,
calculateRecords,
@@ -284,7 +287,9 @@ const DataManagementPage: React.FC<DataManagementPageProps> = ({ selectedKandang
const diffMs = todayMs - startDateMs;
const actualCurrentDay = diffMs >= 0 ? Math.floor(diffMs / (1000 * 60 * 60 * 24)) : 0;
const maxDay = cycleData.currentDay;
// Last inclusive 0-based day index matches Estimasi Panen (startDate + totalDays - 1)
const lastCycleDay = Math.max(0, (cycleData.totalDays || 1) - 1);
const maxDay = Math.min(cycleData.currentDay ?? 0, lastCycleDay);
// Fetch chicken counting data
const chickenCountMap: Record<number, number> = {};