fix hitung karung page table data not showing
This commit is contained in:
1 parent
d9e04a2bd7
commit
7dcd7b74cb
1 file changed
+3
-3
@@ -69,9 +69,9 @@ const FeedSackCountingPage: React.FC<{ onSettings: () => void }> = ({ onSettings
|
|||||||
const latestManual = sortedManualRows.find((row) => row.date === displayDate) ?? null;
|
const latestManual = sortedManualRows.find((row) => row.date === displayDate) ?? null;
|
||||||
const currentDay = useMemo(() => {
|
const currentDay = useMemo(() => {
|
||||||
if (!selectedCycle) return 0;
|
if (!selectedCycle) return 0;
|
||||||
const rawDay = cycleDayForDate(selectedCycle.start_date, displayDate);
|
const boundDate = selectedCycle.end_date ?? selectedCycle.visible_through_date ?? todayIso();
|
||||||
return Math.min(rawDay, Math.max(0, selectedCycle.total_days - 1));
|
return cycleDayForDate(selectedCycle.start_date, boundDate);
|
||||||
}, [selectedCycle, displayDate]);
|
}, [selectedCycle]);
|
||||||
|
|
||||||
const handleSync = useCallback(async () => {
|
const handleSync = useCallback(async () => {
|
||||||
if (!selectedCycle) return;
|
if (!selectedCycle) return;
|
||||||
|
|||||||
Reference in new issue
Block a user