"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.diffInDaysBetweenDates = diffInDaysBetweenDates;
exports.calculateClusterDateDiff = calculateClusterDateDiff;
const constants_1 = require("../config/constants");
function diffInDaysBetweenDates(inputDate) {
    const dateObject = new Date(inputDate);
    const today = new Date();
    return Math.floor(Math.abs(today.valueOf() - dateObject.valueOf()) / constants_1.MS_PER_DAY);
}
function calculateClusterDateDiff(inactiveDeletionDays, completedAt) {
    if (completedAt && completedAt !== constants_1.TIME_ZERO) {
        return inactiveDeletionDays - diffInDaysBetweenDates(completedAt);
    }
    else {
        return inactiveDeletionDays;
    }
}
//# sourceMappingURL=DateAndTime.js.map