export var isEqual = function isEqual(a, b) {
  return Boolean(!a && !b || a && b && a.year === b.year && a.month === b.month && a.date === b.date);
};
export var comparator = function comparator(a, b) {
  if (a.year < b.year) {
    return -1;
  } else if (a.year > b.year) {
    return 1;
  } else if (a.month < b.month) {
    return -1;
  } else if (a.month > b.month) {
    return 1;
  } else if (a.date < b.date) {
    return -1;
  } else if (a.date > b.date) {
    return 1;
  }
  return 0;
};
export var create = function create(date, month, year) {
  return {
    date: date,
    month: month,
    year: year
  };
};
export var isLess = function isLess(left, right) {
  return comparator(left, right) === -1;
};
export var isLessOrEqual = function isLessOrEqual(left, right) {
  return isLess(left, right) || isEqual(left, right);
};
export var isGreater = function isGreater(left, right) {
  return !isLessOrEqual(left, right);
};
export var isGreaterOrEqual = function isGreaterOrEqual(left, right) {
  return !isLess(left, right);
};
export var isBetween = function isBetween(date, left, right) {
  if (left && isLess(date, left)) {
    return false;
  }
  if (right && isGreater(date, right)) {
    return false;
  }
  return true;
};
export var fromString = function fromString(dateString) {
  var _dateString$split$map = dateString.split('.').map(Number),
    date = _dateString$split$map[0],
    month = _dateString$split$map[1],
    year = _dateString$split$map[2];
  return create(date, month, year);
};
export var toString = function toString(_ref) {
  var date = _ref.date,
    month = _ref.month,
    year = _ref.year;
  var _map = [date, month, year].map(function (x) {
      return x.toString();
    }),
    d = _map[0],
    m = _map[1],
    y = _map[2];
  return d.padStart(2, '0') + "." + m.padStart(2, '0') + "." + y.padStart(4, '0');
};