javascriptreactjsreact-dates

react-dates component doesn't allow selection of dates prior to current date


I am using airbnb's DateRangePicker. Its current behavior doesn't allow selection of dates prior to the present date. How do I change it to allow selection of past dates as start date? here is the code being used


Solution

  • Just so you know, this is fully configurable and you can specify a prop to determine if a given candidate date is valid for entry (by default, this function makes dates in the past invalid, I believe)

    Just pass this prop to determine that every date is in range:

    <DRP isOutsideRange={() => false} />
    

    For a little more context, see this issue where I found the answer