function correctFormat(value, dateFormat) {
  var dateFromDate = (0, _moment.default)((0, _date.getNormalizedDate)(value));
  var dateFromMoment = (0, _moment.default)(value, dateFormat);
  var isAlphanumeric = value.search(/[A-z]/g) > -1;
  var date;

  if (dateFromDate.isValid() && dateFromDate.format('x') === dateFromMoment.format('x') || !dateFromMoment.isValid() || isAlphanumeric) {
    date = dateFromDate;
  } else {
    date = dateFromMoment;
  }

  return date.format(dateFormat);
}
Format the given string using moment.js' format feature

@param {String} value
@param {String} dateFormat
@returns {String}