@nesto-software/moment-holiday-germany
Version:
The german locale for moment-holiday.
55 lines • 2.74 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var moment_holiday_core_1 = require("@nesto-software/moment-holiday-core");
var url = require("url");
var common_state_holiday_definitions_1 = require("./common-state-holiday-definitions");
var holiday_names_1 = require("./holiday-names");
var BEStateLocale = /** @class */ (function (_super) {
__extends(BEStateLocale, _super);
function BEStateLocale() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.legislation = new moment_holiday_core_1.Legislation("Gesetz über die Sonn- und Feiertage",
// tslint:disable-next-line:max-line-length
url.parse("http://gesetze.berlin.de/jportal/?quelle=jlink&query=FeiertG+BE+%C2%A7+1&psml=bsbeprod.psml&max=true"), "§1 Abs. 1");
return _this;
}
BEStateLocale.prototype.getHolidayDefinitions = function () {
return common_state_holiday_definitions_1.COMMON_STATE_HOLIDAY_DEFINITIONS(this.legislation).concat([
{
name: holiday_names_1.HolidayName.WELTFRAUENTAG,
date: moment_holiday_core_1.NonRecurringDate.forPredicate(8, 2, function (year) {
return year > 2018;
}),
tags: [
new moment_holiday_core_1.TypeTag(moment_holiday_core_1.TypeTagValue.PUBLIC),
new moment_holiday_core_1.LegislationTag(this.legislation),
],
}, {
name: holiday_names_1.HolidayName.TAG_DER_BEFREIUNG,
date: moment_holiday_core_1.NonRecurringDate.forPredicate(8, 4, function (year) {
return year === 2020; // only applies for 8.5.2020
}),
tags: [
new moment_holiday_core_1.TypeTag(moment_holiday_core_1.TypeTagValue.PUBLIC),
new moment_holiday_core_1.LegislationTag(this.legislation),
],
},
]);
};
return BEStateLocale;
}(moment_holiday_core_1.AbstractLocale));
exports.BEStateLocale = BEStateLocale;
//# sourceMappingURL=be.state-locale.js.map