retail-calendar
Version:
A configurable retail calendar
17 lines (16 loc) • 758 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var date_utils_1 = require("./date_utils");
var LastDayBeforeEOMStrategy = /** @class */ (function () {
function LastDayBeforeEOMStrategy() {
}
LastDayBeforeEOMStrategy.prototype.getLastDayForGregorianLastDay = function (lastDayOfGregorianYear, lastDayOfIsoWeek, _retailCalendarYear) {
var candidate = date_utils_1.setIsoWeekDay(lastDayOfGregorianYear, lastDayOfIsoWeek);
if (candidate.getMonth() !== lastDayOfGregorianYear.getMonth()) {
candidate = date_utils_1.addWeeksToDate(candidate, -1);
}
return candidate;
};
return LastDayBeforeEOMStrategy;
}());
exports.LastDayBeforeEOMStrategy = LastDayBeforeEOMStrategy;