@iro/calendar
Version:
lunar is a calendar library for Solar and Chinese Lunar.
41 lines • 1.29 kB
JavaScript
var Holiday = (function () {
function Holiday(day, name, work, target) {
this._day = Holiday._ymd(day);
this._name = name;
this._work = work;
this._target = Holiday._ymd(target);
}
Holiday._ymd = function (s) {
return s.indexOf('-') < 0 ? (s.substr(0, 4) + '-' + s.substr(4, 2) + '-' + s.substr(6)) : s;
};
Holiday.prototype.getDay = function () {
return this._day;
};
Holiday.prototype.setDay = function (value) {
this._day = Holiday._ymd(value);
};
Holiday.prototype.getName = function () {
return this._name;
};
Holiday.prototype.setName = function (value) {
this._name = value;
};
Holiday.prototype.isWork = function () {
return this._work;
};
Holiday.prototype.setWork = function (value) {
this._work = value;
};
Holiday.prototype.getTarget = function () {
return this._target;
};
Holiday.prototype.setTarget = function (value) {
this._target = Holiday._ymd(value);
};
Holiday.prototype.toString = function () {
return this._day + ' ' + this._name + (this._work ? '调休' : '') + ' ' + this._target;
};
return Holiday;
}());
export { Holiday };
//# sourceMappingURL=Holiday.js.map