- Allows setting empty value for date custom fields

This commit is contained in:
Vlad
2016-08-14 12:26:01 -04:00
parent 7f091d7188
commit c5a02c6136
5 changed files with 59 additions and 25 deletions

View File

@@ -904,7 +904,7 @@ define(
subscribersClone.subscribers[0][matchedColumn.index] =
'<span class="mailpoet_data_match mailpoet_import_error" title="'
+ MailPoet.I18n.t('noDateFieldMatch') + '">'
+ MailPoet.I18n.t('emptyDate')
+ MailPoet.I18n.t('emptyFirstRowDate')
+ '</span>';
preventNextStep = true;
}
@@ -923,10 +923,10 @@ define(
}
}
jQuery.map(subscribersClone.subscribers, function (data, index) {
if (index === fillerPosition) return;
var rowData = data[matchedColumn.index];
if (index === fillerPosition || rowData.trim() === '') return;
var date = Moment(rowData, testedFormat, true);
// validate date:
// validate date
if (date.isValid()) {
data[matchedColumn.index] +=
'<span class="mailpoet_data_match" title="'