From 77a7c369f32e943c05de150f18f8f5414a197448 Mon Sep 17 00:00:00 2001 From: Caleb Date: Wed, 28 Mar 2018 14:18:07 -0600 Subject: [PATCH] Fix Date Control Regression Fix regression from b7fcb8b. Dates were disappearing completely until the field was clicked into. --- src/components/EditorWidgets/Date/DateControl.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/EditorWidgets/Date/DateControl.js b/src/components/EditorWidgets/Date/DateControl.js index b7f5586f..1b07a272 100644 --- a/src/components/EditorWidgets/Date/DateControl.js +++ b/src/components/EditorWidgets/Date/DateControl.js @@ -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