@shuimo-design/lunar
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

@shuimo-design/lunar

农历转换工具

npm codecov

A Chinese lunar calendar conversion tool.

Usage

import { lunar } from '@shuimo-design/lunar';

const lunarDate = new lunar('2024-01-15 17:07:00');
/**
 *  response will be:
 *  {
 *    year: '癸卯',
 *    month: '乙丑',
 *    day: '戊寅',
 *    hour: '辛酉',
 *    minute: '初刻',
 *    term: undefined
 *  }
 */

term

import { lunar } from '@shuimo-design/lunar';

const lunarDate = new lunar('2023-3-6')

/**
 * response will be:
 * {
 *   year: '癸卯',
 *   month: '乙卯',
 *   day: '癸亥',
 *   hour: '壬子',
 *   minute: '正刻',
 *   term: '惊蛰'
 * }
 */

参考资料

日期转换 https://github.com/isee15/Lunar-Solar-Calendar-Converter

节气算法 https://github.com/OPN48/cnlunar

学习资料 https://ytliu0.github.io/ChineseCalendar/rules_simp.html

文献

陈久金. 中国古代时制研究及其换算[J]. 自然科学史研究, 1983 (2): 118-132.

Readme

Keywords

Package Sidebar

Install

npm i @shuimo-design/lunar

Weekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

286 kB

Total Files

39

Last publish

Collaborators

  • hi_guaifan