How to use the astronomia/lib/moonphase.new 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 / lib / Chinese.js View on Github external
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;
    }
github commenthol / date-chinese / lib / Chinese.js View on Github external
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;
    }