I want to set 5:00 PM as min time in TimePickerAndroid. How can I set it?
this.showPicker.bind(this, 'simple', {
hour: new Date().getHours(),
minute: new Date().getMinutes(),
minHour: this.props.minHour // I am passing 5 as minHour prop
})
I tried this but didn't work.
To set the minimum time to 5 PM in TimePickerAndroid, you can set the minHour prop to 17 and minMinute prop to 0:
this.showPicker.bind(this, 'simple', { hour: new Date().getHours(), minute: new Date().getMinutes(), minHour: 17, minMinute: 0 })
This will set the minimum time to 5 PM (17:00) in the TimePickerAndroid.
Note that the minHour and minMinute props are optional, and if not specified, the TimePickerAndroid will allow selecting any time.