jewish-calendar
Version:
A comprehensive Jewish Calendar library for date conversion and calculations
22 lines (21 loc) • 749 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RoshChodesh = void 0;
const molad_1 = require("./molad");
class RoshChodesh {
constructor(year, month) {
this.year = year;
this.month = month;
this.molad = new molad_1.Molad(this.monthsElapsedFromCreation());
}
monthsElapsedFromCreation() {
const commonMonths = (this.year - 1) * 12;
const leapMonths = Math.floor((this.year - 1) / 19) * 7 + // Leap months in previous cycles
Math.floor((((this.year - 1) % 19) * 7) / 19); // Leap months in this cycle
return commonMonths + leapMonths + this.month;
}
getMolad() {
return this.molad;
}
}
exports.RoshChodesh = RoshChodesh;