npm

This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

calunar

0.1.3 • Public • Published

calunar

Util for calculating lunar date.

NPM Travis Coverage Status

Installation

npm install calunar

Usage

import Calunar from 'calunar';

let lunarDate = Calunar.solar2Lunar(25, 11, 2011, 7);
console.log(lunarDate); // return 1/11/2011

API

solar2Lunar(dd, mm, yy, timeZone)

Comvert solar date dd/mm/yyyy to the corresponding lunar date.

Calunar.solar2Lunar(9, 2, 2016, 7); // return 2/1/2016
jdFromDate(dd, mm, yy)

Compute the (integral) Julian day number of day dd/mm/yyyy, i.e., the number of days between 1/1/4713 BC (Julian calendar) and dd/mm/yyyy.

Formula from http://www.tondering.dk/claus/calendar.html

Calunar.jdFromDate(12, 10, 1812); // return 2383164
jdToDate(jd)

Convert a Julian day number to day/month/year. Parameter jd is an integer.

Calunar.jdToDate(2383164); // return [12, 10, 1812]

Test

npm install
npm test

License

The MIT License (MIT)

Package Sidebar

Install

npm i calunar

Homepage

techpush.net

Weekly Downloads

1

Version

0.1.3

License

The MIT License (MIT)

Last publish

Collaborators

  • dongnd