Socket
Socket
Sign inDemoInstall

calunar

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

calunar

Calunar: util for handling lunar date


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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)

Keywords

FAQs

Package last updated on 18 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc