@iro/calendar
Version:
lunar is a calendar library for Solar and Chinese Lunar.
36 lines • 1.06 kB
JavaScript
import { SolarMonth } from './SolarMonth';
var SolarYear = (function () {
function SolarYear(year) {
this._year = year;
}
SolarYear.fromYear = function (year) {
return new SolarYear(year);
};
SolarYear.fromDate = function (date) {
return SolarYear.fromYear(date.getFullYear());
};
SolarYear.prototype.getYear = function () {
return this._year;
};
SolarYear.prototype.next = function (years) {
return SolarYear.fromYear(this._year + years);
};
SolarYear.prototype.getMonths = function () {
var l = [];
var m = SolarMonth.fromYm(this._year, 1);
l.push(m);
for (var i = 1; i < 12; i++) {
l.push(m.next(i));
}
return l;
};
SolarYear.prototype.toString = function () {
return "".concat(this.getYear());
};
SolarYear.prototype.toFullString = function () {
return "".concat(this.getYear(), "\u5E74");
};
return SolarYear;
}());
export { SolarYear };
//# sourceMappingURL=SolarYear.js.map