Fix Date Control Regression

Fix regression from b7fcb8b. Dates were disappearing completely until
the field was clicked into.
This commit is contained in:
Caleb 2018-03-28 14:18:07 -06:00 committed by Shawn Erquhart
parent d5cd79f2c4
commit 77a7c369f3

View File

@ -20,9 +20,10 @@ export default class DateControl extends React.Component {
includeTime: PropTypes.bool,
};
format = this.props.field.get('format') || (this.props.includeTime ? DEFAULT_DATETIME_FORMAT : DEFAULT_DATE_FORMAT);
componentDidMount() {
const { includeTime, value, field, onChange } = this.props;
this.format = field.get('format') || (includeTime ? DEFAULT_DATETIME_FORMAT : DEFAULT_DATE_FORMAT);
const { value } = this.props;
/**
* Set the current date as default value if no default value is provided. An