fix date picker panel iot that is not selectable

This commit is contained in:
Alberto-Audrix committed 2026-09-22 11:29:52 +07:00
1 parent 520c4bcaad
commit 050664eba2
1 file changed
+4 -1
+4 -1
View File
@@ -253,7 +253,10 @@ const IotPanelPage: React.FC<{ onSettings: () => void }> = ({ onSettings }) => {
}, [selectedKandang, selectedCycle, summary, dayAge, selectedDate]);
const datePickerMin = selectedCycle?.start_date ?? undefined;
const datePickerMax = selectedCycle ? resolveCycleBoundDate(selectedCycle) : undefined;
// IoT panel is real-time — not subject to the publish cutoff that
// resolveCycleBoundDate() applies via soft_end_date → visible_through_date().
// Closed cycles use end_date; open cycles go up to today.
const datePickerMax = selectedCycle?.end_date ?? todayIso();
if (!selectedCycle) return <EmptyFarm onSettings={onSettings} />;