Skip to content

Commit

Permalink
fix(datepicker): fix warns when pass moment instance to date prop
Browse files Browse the repository at this point in the history
  • Loading branch information
feyy committed Oct 18, 2017
1 parent c57aece commit 7450bba
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ class DatePicker extends Component {
this.setState({
allowPointerEvents: false,
date: date
})
});
const timeoutId = setTimeout(() => {
this.setState({
allowPointerEvents: true
})
clearTimeout(timeoutId)
});
clearTimeout(timeoutId);
}, 200);
}

Expand Down Expand Up @@ -305,7 +305,7 @@ class DatePicker extends Component {
} = this.props;

if (showIcon) {
if (!!iconComponent) {
if (iconComponent) {
return iconComponent;
}
return (
Expand Down Expand Up @@ -452,7 +452,7 @@ DatePicker.defaultProps = {
DatePicker.propTypes = {
mode: PropTypes.oneOf(['date', 'datetime', 'time']),
androidMode: PropTypes.oneOf(['calendar', 'spinner', 'default']),
date: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]),
date: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date), PropTypes.object]),
format: PropTypes.string,
minDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]),
maxDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]),
Expand Down

0 comments on commit 7450bba

Please sign in to comment.