diff --git a/assets/js/src/newsletters/send/date_text.jsx b/assets/js/src/newsletters/send/date_text.jsx index b30da4aacc..e35908b1f1 100644 --- a/assets/js/src/newsletters/send/date_text.jsx +++ b/assets/js/src/newsletters/send/date_text.jsx @@ -75,7 +75,7 @@ class DateText extends React.Component { jQuery.datepicker.parseDate = function parseDate(format, value) { // Transform string format to Date object return MailPoet.Date.toDate(value, { - parseFormat: this.props.dateDisplayFormat, + parseFormat: this.props.displayFormat, format, }); }; @@ -163,7 +163,6 @@ DateText.propTypes = { value: PropTypes.string.isRequired, disabled: PropTypes.bool.isRequired, validation: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types - dateDisplayFormat: PropTypes.string.isRequired, }; DateText.defaultProps = { diff --git a/assets/js/src/newsletters/send/date_time.jsx b/assets/js/src/newsletters/send/date_time.jsx index ef0c54157e..ce04480b1f 100644 --- a/assets/js/src/newsletters/send/date_time.jsx +++ b/assets/js/src/newsletters/send/date_time.jsx @@ -5,7 +5,11 @@ import DateText from 'newsletters/send/date_text.jsx'; import TimeSelect from 'newsletters/send/time_select.jsx'; class DateTime extends React.Component { - state = this.buildStateFromProps(this.props); + constructor(props) { + super(props); + + this.state = this.buildStateFromProps(props); + } componentWillReceiveProps(nextProps) { this.setState(this.buildStateFromProps(nextProps)); @@ -74,7 +78,7 @@ DateTime.propTypes = { onChange: PropTypes.func, name: PropTypes.string, disabled: PropTypes.bool, - dateValidation: PropTypes.objectOf(PropTypes.string).isRequired, + dateValidation: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types timeValidation: PropTypes.any, // eslint-disable-line react/forbid-prop-types timeOfDayItems: PropTypes.objectOf(PropTypes.string).isRequired, }; diff --git a/assets/js/src/newsletters/send/time_select.jsx b/assets/js/src/newsletters/send/time_select.jsx index 0617895c1d..55f402deb0 100644 --- a/assets/js/src/newsletters/send/time_select.jsx +++ b/assets/js/src/newsletters/send/time_select.jsx @@ -34,7 +34,7 @@ TimeSelect.propTypes = { value: PropTypes.string.isRequired, disabled: PropTypes.bool, onChange: PropTypes.func.isRequired, - validation: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types + validation: PropTypes.object, // eslint-disable-line react/forbid-prop-types }; TimeSelect.defaultProps = {