Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
value: function previousNewMoon(jde) {
var nm = this.midnight(moonphase.new(toYear(jde)));
var cnt = 0;
while (nm > jde && cnt++ < 4) {
nm = this.midnight(moonphase.new(toYear(jde - cnt * lunarOffset)));
}
return nm;
}
value: function nextNewMoon(jde) {
var nm = this.midnight(moonphase.new(toYear(jde)));
var cnt = 0;
while (nm < jde && cnt++ < 4) {
nm = this.midnight(moonphase.new(toYear(jde + cnt * lunarOffset)));
}
return nm;
}