我正在使用 react-native-calendar-picker 库
如何禁用日期 b/w 选择的 startdate 和 enddate
请帮帮我!
https://www.npmjs.com/package/react-native-calendar-picker
onDateChange(date, type) {
//function to handle the date change
console.log("date",date,type)
if (type === 'END_DATE') {
this.setState({
selectedEndDate:moment(date).format("YYYYMMDD"),
});
} else {
this.setState({
selectedStartDate: moment(date).format("YYYYMMDD"),
selectedEndDate: null,
});
}
}
这里渲染函数
<CalendarPicker
startFromMonday={true}
allowRangeSelection={true}
minDate={minDate}
maxDate={maxDate}
weekdays={['Mon', 'Tue', 'Wed', 'Thur', 'Fri', 'Sat', 'Sun']}
months={[
'January',
'Febraury',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December',
]}
previousTitle="Previous"
nextTitle="Next"
todayBackgroundColor="#e756001a"
selectedDayColor="#FFC926"
selectedDayTextColor="#000000"
scaleFactor={375}
textStyle={{
fontFamily: 'Cochin',
color: '#000000',
}}
onDateChange={this.onDateChange}
/>