import { isEqual } from 'date-fns';
import { isDateValid } from './isDateValid';
export function areDatesEqual() {
  var dateLeft = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  var dateRight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  var isDateLeftValid = isDateValid(dateLeft);
  var isDateRightValid = isDateValid(dateRight);
  var bothNull = dateLeft == null && dateRight == null;
  var bothInvalid = dateLeft && dateRight && !isDateLeftValid && !isDateRightValid;
  var bothEqual = isDateLeftValid && isDateRightValid && isEqual(dateLeft, dateRight);
  return bothNull || bothInvalid || bothEqual;
}