|
|
@ -27,7 +27,14 @@ class DatePickerAndroid extends React.PureComponent { |
|
|
|
|
|
|
|
if (props.modal) return null |
|
|
|
|
|
|
|
return <NativeComponent {...props} onChange={this._onChange} /> |
|
|
|
return ( |
|
|
|
<NativeComponent |
|
|
|
{...props} |
|
|
|
maximumDate={this._withoutSecond(props.maximumDate)} |
|
|
|
minimumDate={this._withoutSecond(props.minimumDate)} |
|
|
|
onChange={this._onChange} |
|
|
|
/> |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
getId = () => { |
|
|
@ -110,6 +117,13 @@ class DatePickerAndroid extends React.PureComponent { |
|
|
|
this.isClosing = true |
|
|
|
this.props.onCancel() |
|
|
|
} |
|
|
|
|
|
|
|
_withoutSecond = (date) => { |
|
|
|
if (!date) return date |
|
|
|
date.setSeconds(0) |
|
|
|
date.setMilliseconds(0) |
|
|
|
return date |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
export default DatePickerAndroid |