I am trying to create a function that return open date picker will return the next day of today's date, example: today's date is Oct 1, 2021 so the next day will be Oct 2, 2021.
Here is my code base:
openToDate(val:any){
console.log("val: ", val)
return moment(val).toDate();
}
<DatePicker
customInput={
<React.Fragment>
<input
tabIndex={this.props.tabIndex}
className="exact-date-input"
placeholder={this.props.placeholder}
autoComplete="off"
type="text"
maxLength={10}
id="date-input"
aria-label={ariaLabel}
value={this.state.inputValue}
onKeyDown={this.onKeyDownDateType}
onClick={()=>this.openOrCloseDatePicker(true, this.state.error)}
onFocus={()=>this.openOrCloseDatePicker(true, this.state.error)}
onBlur={()=>this.emptyIfError(this.state.error)}
/>
</React.Fragment>
}
openToDate={this.openToDate(this.props.value)}
tabIndex={-1}
selected={this.openToDate(this.props.value)}
customInputRef="dateInput"
autoComplete="off"
id={this.props.id}
onChange={this.handleInput}
required={this.props.required}
minDate={moment(today).toDate()}
maxDate={moment(endRange).toDate()}
open={this.state.datePickerIsOpen}
onClickOutside={()=>this.openOrCloseDatePicker(false, this.state.error)}
/>
How can I make today's date disable and auto selected will be the next day ?
