"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function monthInMin(year, month, minDate) {
    if (minDate) {
        return new Date(year, month, 1) >= new Date(minDate.getFullYear(), minDate.getMonth(), 1);
    }
    return true;
}
exports.monthInMin = monthInMin;
function monthInMax(year, month, maxDate) {
    if (maxDate) {
        var thisMonth = new Date(year, month, 1);
        var max = new Date(maxDate.getFullYear(), maxDate.getMonth(), 1);
        return thisMonth <= max;
    }
    return true;
}
exports.monthInMax = monthInMax;
function stripTime(date) {
    return new Date(date.getFullYear(), date.getMonth(), date.getDate());
}
function isOutOfDateRange(dateObj, min, max) {
    return Boolean((min && dateObj < stripTime(min)) || (max && stripTime(dateObj) > max));
}
exports.isOutOfDateRange = isOutOfDateRange;
function toDate(d) {
    if (d instanceof Date) {
        return d;
    }
    if (typeof d === 'string' || typeof d === 'number') {
        return new Date(d);
    }
    return new Date();
}
exports.toDate = toDate;

/*# sourceMappingURL=date-utils.js.map*/