我想从日期范围选择器中删除截至今天的天数和从今天开始的天数我该怎么做我的代码片段是,
class BetterDatePicker extends Component {
constructor(props) {
super(props);
this.state = {
selectionRange: {
startDate: new Date(),
endDate: new Date(),
key: 'selection',
}
}
}
handleSelect = (ranges) => {
console.log("range", ranges);
this.setState({
selectionRange: ranges.selection
})
}
render() {
return (
<DateRangePicker
ranges={[this.state.selectionRange]}
onChange={this.handleSelect}
minDate={new Date('2020')}
maxDate={new Date('2022')}
/>
)
}
}