fix value prop of DatePicker to controlled prop

This commit is contained in:
afc163 2015-12-12 13:38:25 +08:00
parent dce02dd5f9
commit 41660c3814

View File

@ -75,7 +75,9 @@ function createPicker(TheCalendar, defaultFormat) {
});
},
handleChange(value) {
this.setState({value});
if (!('value' in this.props)) {
this.setState({ value });
}
const timeValue = value ? new Date(value.getTime()) : null;
// onSelect .
if (this.props.onSelect) {