diff --git a/assets/css/src/form.styl b/assets/css/src/form.styl index 90dda5fd63..999681a9ad 100644 --- a/assets/css/src/form.styl +++ b/assets/css/src/form.styl @@ -1,2 +1,5 @@ +.mailpoet_form + margin: 0 0 20px 0 + .mailpoet_form td - vertical-align: top !important \ No newline at end of file + vertical-align: top !important diff --git a/assets/js/src/form/fields/date.jsx b/assets/js/src/form/fields/date.jsx index 0b6de1644d..2d7b49deae 100644 --- a/assets/js/src/form/fields/date.jsx +++ b/assets/js/src/form/fields/date.jsx @@ -9,6 +9,13 @@ define([ render() { const yearsRange = 100; const years = []; + + if (this.props.empty_value_label !== undefined) { + years.push(( + + )); + } + const currentYear = Moment().year(); for (let i = currentYear; i >= currentYear - yearsRange; i--) { years.push(( @@ -33,6 +40,13 @@ define([ class FormFieldDateMonth extends React.Component { render() { const months = []; + + if (this.props.empty_value_label !== undefined) { + months.push(( + + )); + } + for (let i = 1; i <= 12; i++) { months.push(( + )); + } + for (let i = 1; i <= 31; i++) { days.push(( + ); + } + + if (this.props.field['filter'] !== undefined) { + filter = this.props.field.filter; + } const options = Object.keys(values).map( (value, index) => { + + if (filter !== false && filter(this.props.item, value) === false) { + return; + } + return (