UNPKG

retail-calendar

Version:
17 lines (16 loc) 758 B
"use strict"; 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;