How to use the astronomia/lib/moonphase.newMoon function in astronomia

To help you get started, we’ve selected a few astronomia examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github commenthol / date-chinese / src / Chinese.js View on Github external
nextNewMoon (jde) {
    let nm = this.midnight(moonphase.newMoon(toYear(jde)))
    let cnt = 0
    while (nm < jde && cnt++ < 4) {
      nm = this.midnight(moonphase.newMoon(toYear(jde + cnt * lunarOffset)))
    }
    return nm
  }
github commenthol / date-chinese / src / Chinese.js View on Github external
previousNewMoon (jde) {
    let nm = this.midnight(moonphase.newMoon(toYear(jde)))
    let cnt = 0
    while (nm > jde && cnt++ < 4) {
      nm = this.midnight(moonphase.newMoon(toYear(jde - cnt * lunarOffset)))
    }
    return nm
  }
github commenthol / date-chinese / src / Chinese.js View on Github external
previousNewMoon (jde) {
    let nm = this.midnight(moonphase.newMoon(toYear(jde)))
    let cnt = 0
    while (nm > jde && cnt++ < 4) {
      nm = this.midnight(moonphase.newMoon(toYear(jde - cnt * lunarOffset)))
    }
    return nm
  }