Hi i am using latest versions of both react-native and tcomb-form-native.
minDate and maxDate options does not works for ios datepicker.
it seems this options are set as maximumDate and minimumDate as prop.They are not set in config object like android.
```
{
stylesheet: styles.datePickerStyles,
config: {
format: (value) => moment(value).format("MM/DD/YYYY"),
},
mode: "date",
maximumDate:moment(new Date())
}
@semirturgay I have the same problem, could you tell me how can you solve that?
@ngnclht1102 reason of problem is moment(new Date()).When you use moment(new Date()),it returns object.But maximumDate only accept Date as type of value.As a result of you should convert moment() object to Date type with toDate() method.Here is right:
{
stylesheet: styles.datePickerStyles,
config: {
format: (value) => moment(value).format("MM/DD/YYYY"),
},
mode: "date",
maximumDate:moment(new Date()).toDate()
}
@yasemincidem Thanks, I got it. It worked!!
Most helpful comment
@ngnclht1102 reason of problem is
moment(new Date()).When you use moment(new Date()),it returns object.But maximumDate only acceptDateas type of value.As a result of you should convertmoment()object toDatetype withtoDate()method.Here is right: