React-dates: SingleDatePicker can't select past dates

Created on 10 Oct 2018  路  1Comment  路  Source: airbnb/react-dates

In SingleDatePicker component, enableOutsideDays prop doesn't enable selecting past dates. It even isn't working in the playbook:

http://airbnb.io/react-dates/?selectedKind=SDP%20-%20Calendar%20Props&selectedStory=with%20outside%20days%20enabled&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybook%2Factions%2Factions-panel

Version used: 17.2.0

Most helpful comment

@artur-gajewski enableOutsideDays is for displaying those days in the month that belong to the previous or next month. If you want to select past days, pass in isOutsideRange={() => false}. There's a story for selecting past dates:

http://airbnb.io/react-dates/?selectedKind=SDP%20-%20Day%20Props&selectedStory=allows%20all%20days%2C%20including%20past%20days&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybook%2Factions%2Factions-panel

>All comments

@artur-gajewski enableOutsideDays is for displaying those days in the month that belong to the previous or next month. If you want to select past days, pass in isOutsideRange={() => false}. There's a story for selecting past dates:

http://airbnb.io/react-dates/?selectedKind=SDP%20-%20Day%20Props&selectedStory=allows%20all%20days%2C%20including%20past%20days&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybook%2Factions%2Factions-panel

Was this page helpful?
0 / 5 - 0 ratings