Reputation: 5944
I have a calendar on react-native, and I need it to have some dates disabled (not choosable by user, i.e. every Tuesday and Friday). I don't see such options in docs
https://facebook.github.io/react-native/docs/datepickerandroid.html
https://facebook.github.io/react-native/docs/datepickerios.html
Is there a way to do that?
"react-native": "0.55.2"
Upvotes: 0
Views: 891
Reputation: 1470
I think you can use this
<DatePickerIOS
date={this.state.chosenDate}
onDateChange={(date) => {
if(date.getDay() != '2' || date.getDay() != '5') {
this.setState({chosenDate: newDate})
}
else {
this.setState({error:'you can not select this date ...'})
}
}}
/>
Upvotes: 1