Skip to content

Commit

Permalink
Merge pull request #4052 from RawandDev/fix-selects-range
Browse files Browse the repository at this point in the history
fix: fix selects range acts as default picker
  • Loading branch information
martijnrusschen committed Jun 14, 2023
2 parents 98f4ace + e7d7fc6 commit e763afb
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docs-site/src/examples/dateRangeWithShowDisabledNavigation.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
() => {
const [startDate, setStartDate] = useState(null);
const [startDate, setStartDate] = useState(new Date());
const [endDate, setEndDate] = useState(null);
const onChange = (dates) => {
const [start, end] = dates;
setStartDate(start);
setEndDate(end);
};
return (
<DatePicker
selected={startDate}
onChange={(date) => setStartDate(date)}
onChange={onChange}
minDate={new Date()}
maxDate={addMonths(new Date(), 5)}
startDate={startDate}
endDate={endDate}
selectsRange
inline
showDisabledMonthNavigation
/>
);
Expand Down

0 comments on commit e763afb

Please sign in to comment.