How to use the astronomia.julian.CalendarGregorian 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 / test / korean.mocha.js View on Github external
it(t, function () {
        var y = date.getFullYear()
        var jde = cal.newYear(y)
        var res = new julian.CalendarGregorian().fromJDE(jde).toDate()
        var td = new Date(t)
        var err = Math.abs(+res - +td)
        // test max error 2sec
        assert.ok(err < 1000, res.toISOString() + ' !== ' + t)
      })
    })
github commenthol / date-chinese / test / chinese.mocha.js View on Github external
it(y, function () {
        let cal = new CalendarChinese()
        let qm = cal.qingming(y)
        cal.fromJDE(qm)
        let gre = cal.toGregorian()
        assert.deepEqual(gre, test[1])
        // converting to Gregorian using jde
        let gcal = new julian.CalendarGregorian().fromJDE(qm)
        let ts = cal.timeshiftUTC(gcal)
        let date = new Date(+(gcal.toDate()) + ts * 86400000)
        assert.equal(date.toISOString(), test[2])
      })
    })
github commenthol / date-chinese / test / vietnamese.mocha.js View on Github external
it(t, function () {
        var y = date.getFullYear()
        var jde = cal.newYear(y)
        var res = new julian.CalendarGregorian().fromJDE(jde).toDate()
        var td = new Date(t)
        var err = Math.abs(+res - +td)
        // test max error 2sec
        assert.ok(err < 1000, res.toISOString() + ' !== ' + t)
      })
    })
github commenthol / date-chinese / test / japanese.mocha.js View on Github external
it([year, test.sekki].join(' '), function () {
            let jde = cal.solarTerm(test.sekki, year)
            let res = new julian.CalendarGregorian().fromJDE(jde).toDate().toISOString()
            assert.equal(res, new Date(test.exp).toISOString())
          })
        })