lunar-calendar-plus
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

lunar-calendar-plus 老黄历|万年历

说明-Introduction:

lunar-calendar-plus 以函数调用方式灵活获取包括 24 节气、生肖、天干地支、阴历日期、每日宜忌(目前 0.0.1 仅支持以上功能)。支持自定义阴阳历节日。

安装-Installation:

  • Npm
npm install lunar-calendar-plus
  • 浏览器
window.LunarCalendar();

示例-Example:

  1. 引入方式:
const calendar = require("lunarCalendarPlus");
  1. 案例:
const calendar = require("lunarCalendarPlus");

/*
 * 如果实例化时为指定日期,则在调用实例方法时若不传入任何参数将自动取值为实例化时指定的日期
 **/

// 支持指定日期
var date = new calendar(new Date());
// 可以为空
date.getMonth(2021, 1);
date.getDay(2021, 1, 1);

方法-Usage:

  1. getMonth() : Array

    返回指定月份的所有阴历时间,为空时自动取值为实例化时指定的日期

    • @params year|''|new Date()
    • @params month|''
  2. getDay() : Object

    返回指定日期的阴历时间,为空时自动取值为实例化时指定的日期

    • @params year|''|new Date()
    • @params month|''
    • @params day|''
  3. getSigns() : String

    返回指定年份生肖,为空时自动取值为实例化时指定的日期

    • @params year|''|new Date()
  4. getTZ() : Object

    返回指定日期的年干、月干、日干,为空时自动取值为实例化时指定的日期

    • @params year|''|new Date()
    • @params month|''
    • @params day|''
  5. getTerm() : Object

    返回指定日期的节气,为空时自动取值为实例化时指定的日期

    • @params year|''|new Date()
    • @params month|''
    • @params day|''
  6. getAll() : Object

    返回指定日期的所有信息(包含以上方法所有信息),为空时自动取值为实例化时指定的日期

    • @params year|''|new Date()
    • @params month|''
    • @params day|''

Dependents (0)

Package Sidebar

Install

npm i lunar-calendar-plus

Weekly Downloads

4

Version

0.0.2

License

ISC

Unpacked Size

44.9 kB

Total Files

16

Last publish

Collaborators

  • whildtechnician