Closed frmdstryr closed 7 years ago
Useful for implementing widgets with custom handlers using onPress. For example, a DatePickerAndroid implementation can be done via:
<GiftedForm.RowValueWidget title='Date of birth' name='dateOfBirth' // mandatory displayValue='dateOfBirth' image={<Icon name={tk+'-calendar'} size={iconSize} style={styles.icon} />} value={this.state.dateOfBirth} onPress={() => { DatePickerAndroid.open({ date: (this.state.dateOfBirth)? Date.parse(this.state.dateOfBirth): new Date(), maxDate: new Date(), mode: 'spinner', }).then((r)=>{ if (r.action !== DatePickerAndroid.dismissedAction) { // Selected year, month (0-11), day this.setState({dateOfBirth:`${r.month}/${r.day}/${r.year}`}); } }).catch((code,message)=>console.warn('Cannot open date picker', message)); }} />
With this widget.
Useful for implementing widgets with custom handlers using onPress. For example, a DatePickerAndroid implementation can be done via:
With this widget.