react-dates 组件不允许选择当前日期之前的日期
react-dates component doesn't allow selection of dates prior to current date
我正在使用airbnb的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是正在使用的代码
如你所知,这是完全可配置的,你可以指定一个道具来确定给定的候选日期是否有效(我相信默认情况下,此功能会使过去的日期无效)
只需传递此属性即可确定每个日期都在范围内:
<DRP isOutsideRange={() => false} />
有关更多上下文,请参阅 this issue 我找到答案的地方
我正在使用airbnb的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是正在使用的代码
如你所知,这是完全可配置的,你可以指定一个道具来确定给定的候选日期是否有效(我相信默认情况下,此功能会使过去的日期无效)
只需传递此属性即可确定每个日期都在范围内:
<DRP isOutsideRange={() => false} />
有关更多上下文,请参阅 this issue 我找到答案的地方