8

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.

Raj Suvariya
  • 1,592
  • 3
  • 14
  • 36

2 Answers2

0

This library helps solve the issue but as the timepickerandroid api in react-native doesn't have the min & max time properties, hence the min & max time properties can only be set for ios and not for android

You can use this property to set min & max times but it will work only for ios

Marian Nasry
  • 821
  • 9
  • 22
0

According to the documentation, for the react-native-datepicker, minDate is not supported for the Android. It works fine for ios.

I followed the method below to overcome the issue in android.

source - https://stackoverflow.com/a/58400641/9366229

Hope it will help!!