Attendence component date customize

This commit is contained in:
kartik.sharma 2025-05-20 15:25:40 +05:30 committed by Vikas Nale
parent 7a57f47318
commit 4c9ea7add8

View File

@ -4,8 +4,10 @@ const DateRangePicker = ({ onRangeChange, DateDifference = 7,defaultStartDate =
const inputRef = useRef(null); const inputRef = useRef(null);
useEffect(() => { useEffect(() => {
const today = defaultStartDate; const today = new Date();;
today.setDate(today.getDate() - 1);
const fifteenDaysAgo = new Date(); const fifteenDaysAgo = new Date();
fifteenDaysAgo.setDate(today.getDate() - DateDifference); fifteenDaysAgo.setDate(today.getDate() - DateDifference);
const fp = flatpickr(inputRef.current, { const fp = flatpickr(inputRef.current, {