react-native-form-generator
react-native-form-generator copied to clipboard
setTime does not work for TimePicker
the setTime API in TimePicker does not work for ios as there is a missing ref in TimePickerField.ios.js.
setTime(date){
this.refs.datePickerComponent.setDate(date);
}
return(<DatePickerComponent
{...this.props}
mode="time"
=> ref='datePickerComponent'
labelStyle={[formStyles.fieldText, this.props.labelStyle]}
valueStyle = {[formStyles.fieldValue,this.props.valueStyle]}
valueContainerStyle = {[formStyles.alignRight,
formStyles.horizontalContainer, this.props.valueContainerStyle]}
containerStyle={[
formStyles.fieldContainer,
formStyles.horizontalContainer,
this.props.containerStyle,
]}
/>)
Android, too.
My code: this.refs.registrationForm.refs.timeMeeting.setTime(new Date());
My error:

Just raised PR #134 with the fix for those who need it