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 committed Mar 28, 2018
1 parent a19bc04 commit 20b05c0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/EditorWidgets/Date/DateControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ export default class DateControl extends React.Component {
includeTime: PropTypes.bool,
};

componentDidMount() {
const { includeTime, value, field, onChange } = this.props;
constructor(props) {
super(props);
const { field, includeTime } = this.props;
this.format = field.get('format') || (includeTime ? DEFAULT_DATETIME_FORMAT : DEFAULT_DATE_FORMAT);
}

componentDidMount() {
const { value } = this.props;

/**
* Set the current date as default value if no default value is provided. An
Expand Down

0 comments on commit 20b05c0

Please sign in to comment.