function getOverlappingDaysInIntervals(dirtyIntervalLeft, dirtyIntervalRight) {
  __WEBPACK_IMPORTED_MODULE_1__lib_requiredArgs_index_js__["a" /* default */](2, arguments);
  var intervalLeft = dirtyIntervalLeft || {};
  var intervalRight = dirtyIntervalRight || {};
  var leftStartTime = __WEBPACK_IMPORTED_MODULE_0__toDate_index_js__["a" /* default */](intervalLeft.start).getTime();
  var leftEndTime = __WEBPACK_IMPORTED_MODULE_0__toDate_index_js__["a" /* default */](intervalLeft.end).getTime();
  var rightStartTime = __WEBPACK_IMPORTED_MODULE_0__toDate_index_js__["a" /* default */](intervalRight.start).getTime();
  var rightEndTime = __WEBPACK_IMPORTED_MODULE_0__toDate_index_js__["a" /* default */](intervalRight.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`

  if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) {
    throw new RangeError('Invalid interval');
  }

  var isOverlapping = leftStartTime < rightEndTime && rightStartTime < leftEndTime;

  if (!isOverlapping) {
    return 0;
  }

  var overlapStartDate = rightStartTime < leftStartTime ? leftStartTime : rightStartTime;
  var overlapEndDate = rightEndTime > leftEndTime ? leftEndTime : rightEndTime;
  var differenceInMs = overlapEndDate - overlapStartDate;
  return Math.ceil(differenceInMs / MILLISECONDS_IN_DAY);
}
@name getUnixTime
@category Timestamp Helpers
@summary Get the seconds timestamp of the given date.

@description
Get the seconds timestamp of the given date.

### 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).

@param {Date|Number} date - the given date
@returns {Number} the timestamp
@throws {TypeError} 1 argument required

@example
// Get the timestamp of 29 February 2012 11:45:05 CET:
var result = getUnixTime(new Date(2012, 1, 29, 11, 45, 5))
//=> 1330512305