- Fixes varable name typo

- Declares a new variable during date validate
This commit is contained in:
Vlad
2016-08-08 18:10:31 -04:00
parent 4eec0a42f9
commit eb107799a7

View File

@@ -455,7 +455,7 @@ define(
null, null,
new Array(subscribers.subscribers[0].length) new Array(subscribers.subscribers[0].length)
).map(String.prototype.valueOf, filler), ).map(String.prototype.valueOf, filler),
fillterPosition; fillerPosition;
showCurrentStep(); showCurrentStep();
@@ -707,7 +707,7 @@ define(
// display filler data (e.g., ellipsis) if we've reached the maximum number of rows and // display filler data (e.g., ellipsis) if we've reached the maximum number of rows and
// subscribers count is greater than the maximum number of rows we're displaying // subscribers count is greater than the maximum number of rows we're displaying
if (index === maxRowsToShow && subscribers.subscribersCount > (maxRowsToShow + 1)) { if (index === maxRowsToShow && subscribers.subscribersCount > (maxRowsToShow + 1)) {
fillterPosition = index; fillerPosition = index;
return filler; return filler;
} }
// if we're on the last line, show the total count of subscribers data // if we're on the last line, show the total count of subscribers data
@@ -882,7 +882,8 @@ define(
jQuery.map(subscribersClone.subscribers, function (data, position) { jQuery.map(subscribersClone.subscribers, function (data, position) {
var rowData = data[matchedColumn]; var rowData = data[matchedColumn];
var dateFormat = column.params.date_format.toUpperCase(); var dateFormat = column.params.date_format.toUpperCase();
if (position !== fillterPosition) { var date = Moment(rowData, dateFormat, true);
if (position !== fillerPosition) {
// check if date exists // check if date exists
if (rowData.trim() === '') { if (rowData.trim() === '') {
data[matchedColumn] = data[matchedColumn] =
@@ -893,14 +894,12 @@ define(
preventNextStep = true; preventNextStep = true;
return; return;
} }
// check if date is valid and is before today // check if date is valid
if (Moment(rowData, dateFormat, true).isValid() && if (date.isValid()) {
Moment(rowData, dateFormat, true).isBefore(Moment())
) {
data[matchedColumn] += data[matchedColumn] +=
'<span class="mailpoet_data_match" title="' '<span class="mailpoet_data_match" title="'
+ MailPoet.I18n.t('verifyDateMatch') + '">' + MailPoet.I18n.t('verifyDateMatch') + '">'
+ MailPoet.Date.format(Moment(rowData, dateFormat, true)) + MailPoet.Date.format(date)
+ '</span>'; + '</span>';
} }
else { else {