import * as CDS from "../../../components/Calendar/CalendarDateShape";
import { InternalDate } from "../InternalDate";
var stringToDate = function stringToDate(date) {
  return new InternalDate({
    value: date
  }).getComponentsLikeNumber();
};
export var isEqual = function isEqual(left, right) {
  return left === right;
};
export var isLess = function isLess(left, right) {
  var leftDate = stringToDate(left);
  var rightDate = stringToDate(right);
  return CDS.isLess(leftDate, rightDate);
};
export var isLessOrEqual = function isLessOrEqual(left, right) {
  var leftDate = stringToDate(left);
  var rightDate = stringToDate(right);
  return CDS.isLess(leftDate, rightDate) || CDS.isEqual(leftDate, rightDate);
};
export var isGreater = function isGreater(left, right) {
  var leftDate = stringToDate(left);
  var rightDate = stringToDate(right);
  return !CDS.isLessOrEqual(leftDate, rightDate);
};
export var isGreaterOrEqual = function isGreaterOrEqual(left, right) {
  var leftDate = stringToDate(left);
  var rightDate = stringToDate(right);
  return !CDS.isLess(leftDate, rightDate);
};
export var isBetween = function isBetween(between, left, right) {
  var betweenDate = stringToDate(between);
  if (left && CDS.isLess(betweenDate, stringToDate(left))) {
    return false;
  }
  if (right && CDS.isGreater(betweenDate, stringToDate(right))) {
    return false;
  }
  return true;
};