Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_from (j, year) {
let ny = this.newYear(year)
if (ny > j) {
ny = this.newYear(year - 1)
}
let nm = this.previousNewMoon(j)
if (nm < ny) {
nm = ny
}
const years = 1.5 + (ny - this._epoch) / base.BesselianYear
this.cycle = 1 + Math.trunc((years - 1) / 60)
this.year = 1 + Math.trunc((years - 1) % 60)
this.month = this.inMajorSolarTerm(nm).term
const m = Math.round((nm - ny) / moonphase.meanLunarMonth)
if (m === 0) {
this.month = 1
this.leap = false
} else {
this.leap = this.isLeapMonth(nm)
}
if (m > this.month) {
this.month = m
} else if (this.leap) {
this.month--
value: function _from(j, year) {
var ny = this.newYear(year);
if (ny > j) {
ny = this.newYear(year - 1);
}
var nm = this.previousNewMoon(j);
if (nm < ny) {
nm = ny;
}
var years = 1.5 + (ny - this._epoch) / base.BesselianYear;
this.cycle = 1 + Math.trunc((years - 1) / 60);
this.year = 1 + Math.trunc((years - 1) % 60);
this.month = this.inMajorSolarTerm(nm).term;
var m = Math.round((nm - ny) / moonphase.meanLunarMonth);
if (m === 0) {
this.month = 1;
this.leap = false;
} else {
this.leap = this.isLeapMonth(nm);
}
if (m > this.month) {
this.month = m;
} else if (this.leap) {
this.month--;