0

I'm using react-day-picker and I when startDate is selected I want to prevent selection of same date. how is that possible? I tried incrementing startDate by 1 and set It as disabledDays before property but It messed up selection. so which is proper way to achieve this?

 disabledDays = {
      before: startDate,
    };

1 Answers1

0

Maybe there is an easier way, but I achieved this using this:

handleDayClick(day) {
    if (this.state.from && DateUtils.isSameDay(day, this.state.from)) return;
    const range = DateUtils.addDayToRange(day, this.state);
    this.setState(range);
  }
maxpsz
  • 431
  • 3
  • 9