function lightFormat(dirtyDate, dirtyFormatStr) {
  __WEBPACK_IMPORTED_MODULE_5__lib_requiredArgs_index_js__["a" /* default */](2, arguments);
  var formatStr = String(dirtyFormatStr);
  var originalDate = __WEBPACK_IMPORTED_MODULE_0__toDate_index_js__["a" /* default */](dirtyDate);

  if (!__WEBPACK_IMPORTED_MODULE_3__isValid_index_js__["a" /* default */](originalDate)) {
    throw new RangeError('Invalid time value');
  } // Convert the date in system timezone to the same date in UTC+00:00 timezone.
  // This ensures that when UTC functions will be implemented, locales will be compatible with them.
  // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376


  var timezoneOffset = __WEBPACK_IMPORTED_MODULE_2__lib_getTimezoneOffsetInMilliseconds_index_js__["a" /* default */](originalDate);
  var utcDate = __WEBPACK_IMPORTED_MODULE_4__subMilliseconds_index_js__["a" /* default */](originalDate, timezoneOffset);
  var result = formatStr.match(formattingTokensRegExp).map(function (substring) {
    // Replace two single quote characters with one single quote character
    if (substring === "''") {
      return "'";
    }

    var firstCharacter = substring[0];

    if (firstCharacter === "'") {
      return cleanEscapedString(substring);
    }

    var formatter = __WEBPACK_IMPORTED_MODULE_1__lib_format_lightFormatters_index_js__["a" /* default */][firstCharacter];

    if (formatter) {
      return formatter(utcDate, substring, null, {});
    }

    if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
      throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
    }

    return substring;
  }).join('');
  return result;
}
@name max
@category Common Helpers
@summary Return the latest of the given dates.

@description
Return the latest of the given dates.

### v2.0.0 breaking changes:

- [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).

- `max` function now accepts an array of dates rather than spread arguments.

  ```javascript
  // Before v2.0.0
  var date1 = new Date(1989, 6, 10)
  var date2 = new Date(1987, 1, 11)
  var maxDate = max(date1, date2)

  // v2.0.0 onward:
  var dates = [new Date(1989, 6, 10), new Date(1987, 1, 11)]
  var maxDate = max(dates)
  ```

@param {Date[]|Number[]} datesArray - the dates to compare
@returns {Date} the latest of the dates
@throws {TypeError} 1 argument required

@example
// Which of these dates is the latest?
var result = max([
  new Date(1989, 6, 10),
  new Date(1987, 1, 11),
  new Date(1995, 6, 2),
  new Date(1990, 0, 1)
])
//=> Sun Jul 02 1995 00:00:00