From d5b3c25b458c22fd01e0477980f85cacf2ac17af Mon Sep 17 00:00:00 2001 From: pramod mahajan Date: Tue, 9 Sep 2025 13:31:30 +0530 Subject: [PATCH] added flag for pick future date or not --- src/components/Documents/DocumentFilterPanel.jsx | 3 ++- src/components/common/DateRangePicker.jsx | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Documents/DocumentFilterPanel.jsx b/src/components/Documents/DocumentFilterPanel.jsx index 830648a7..c94403fd 100644 --- a/src/components/Documents/DocumentFilterPanel.jsx +++ b/src/components/Documents/DocumentFilterPanel.jsx @@ -96,8 +96,9 @@ const DocumentFilterPanel = ({ entityTypeId, onApply }) => { placeholder="DD-MM-YYYY To DD-MM-YYYY" startField="startDate" endField="endDate" - defaultRange={false} + defaultRange={true} resetSignal={resetKey} + maxDate={new Date()} /> diff --git a/src/components/common/DateRangePicker.jsx b/src/components/common/DateRangePicker.jsx index 2dce634b..c349e25a 100644 --- a/src/components/common/DateRangePicker.jsx +++ b/src/components/common/DateRangePicker.jsx @@ -84,6 +84,7 @@ export const DateRangePicker1 = ({ allowText = false, resetSignal, defaultRange = true, + maxDate = null, ...rest }) => { const inputRef = useRef(null); @@ -117,6 +118,7 @@ export const DateRangePicker1 = ({ mode: "range", dateFormat: "d-m-Y", allowInput: allowText, + maxDate , onChange: (selectedDates) => { if (selectedDates.length === 2) { const [start, end] = selectedDates;