I’m using the DateRangePicker component from react-date-range. I expected that when I selected a startDate later than the endDate, the component would prevent the swap automatically. Additionally, I want the range selection to be allowed only if the endDate is later than the startDate; otherwise, I want the selected date to be treated as the new startDate. However, despite my expectations and attempts to implement conditional logic, the component still swaps the dates when the startDate is later than the endDate.
Bagy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.