export var isEqual = function (a, b) {
    return Boolean((!a && !b) || (a && b && a.year === b.year && a.month === b.month && a.date === b.date));
};
export var comparator = function (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 (date, month, year) { return ({ date: date, month: month, year: year }); };
export var isLess = function (left, right) { return comparator(left, right) === -1; };
export var isLessOrEqual = function (left, right) {
    return isLess(left, right) || isEqual(left, right);
};
export var isGreater = function (left, right) { return !isLessOrEqual(left, right); };
export var isGreaterOrEqual = function (left, right) { return !isLess(left, right); };
export var isBetween = function (date, left, right) {
    if (left && isLess(date, left)) {
        return false;
    }
    if (right && isGreater(date, right)) {
        return false;
    }
    return true;
};
export var fromString = function (dateString) {
    var _a = dateString.split('.').map(Number), date = _a[0], month = _a[1], year = _a[2];
    return create(date, month, year);
};
export var toString = function (_a) {
    var date = _a.date, month = _a.month, year = _a.year;
    var _b = [date, month, year].map(function (x) { return x.toString(); }), d = _b[0], m = _b[1], y = _b[2];
    return "".concat(d.padStart(2, '0'), ".").concat(m.padStart(2, '0'), ".").concat(y.padStart(4, '0'));
};
//# sourceMappingURL=CalendarDateShape.js.map