Abdur Rehman
Abdur Rehman

Reputation: 75

how to disable an array of dates in react-day-picker?

i have an array of dates which i store in a state called "row".

enter image description here

i want to disable these days in react-day-picker

<DayPicker
          selectedDays={this.state.selectedDays}
          onDayClick={this.handleDayClick}
          disabledDays={
                        [{
                           before: new Date(),
                            },]
                       }
                    />

how can i disable these dates in daypicker?

Upvotes: 1

Views: 1606

Answers (1)

abhishake
abhishake

Reputation: 771

As per the documentation, for your problem, you just need to pass an array of days object into disabledDays prop.

check it: http://react-day-picker.js.org/api/DayPicker/#disabledDays

To know how to use the object, you can refer this page: http://react-day-picker.js.org/docs/matching-days/

Upvotes: 1

Related Questions