2

I am using airbnb react dates as a react calendar component. What I want to do is pass an array of dates. And I want to customize the calendar so only those can be selectable by the user. I don't find much in the document. If anyone has ever done this before please let me know. https://github.com/airbnb/react-dates

TylerH
  • 20,799
  • 66
  • 75
  • 101
scripter
  • 1,416
  • 4
  • 19
  • 35

1 Answers1

1

Might be late in the game, but check out isDayBlocked property. It accepts a function that takes a day and returns boolean. e.g. isDayBlocked(day) { return blockedDays.includes(day); }

Another useful prop is isOutsideRange. Has slightly different semantic, but could be useful based on what your requirements are.

More here in "Date selection rules" section: https://github.com/airbnb/react-dates

AndreyM
  • 1,403
  • 2
  • 12
  • 23