Skip to content

Commit

Permalink
Fix Date Control Regression
Browse files Browse the repository at this point in the history
Fix regression from b7fcb8b. Dates were disappearing completely until
the field was clicked into.
  • Loading branch information
tech4him1 authored and erquhart committed Mar 29, 2018
1 parent d5cd79f commit 77a7c36
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/EditorWidgets/Date/DateControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 77a7c36

Please sign in to comment.