npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

shiren-calendar

v0.6.7

Published

实仁日历

Downloads

20

Readme

日历算法

时间支持范围

公元前1000~公元3000年

农历转阳历

console.log(solar2lunar(2021, 11, 11)) // [2021,10,7,false]

阳历转农历

console.log(lunar2solar(2021, 10, 7)) // [2021,11,11]

阳历月份有多少天

console.log(solarMonthHasDays(2021, 11)) // 30

农历月份有多少天

console.log(lunarMonthHasDays(2020, 4)) // 30
console.log(lunarMonthHasDays(2020, 4, true)) // 润4月 29

一年12个节气对应的时间

console.log(yearJieQi(1990))
// [
//     { year: 1990, month: 2, day: 4, dd: 6 }, // dd为下一个节气的开始时间,也是当前节气终止的时间
//     { year: 1990, month: 3, day: 6, dd: 5 },
//     { year: 1990, month: 4, day: 5, dd: 6 },
//     { year: 1990, month: 5, day: 6, dd: 6 },
//     { year: 1990, month: 6, day: 6, dd: 7 },
//     { year: 1990, month: 7, day: 7, dd: 8 },
//     { year: 1990, month: 8, day: 8, dd: 8 },
//     { year: 1990, month: 9, day: 8, dd: 8 },
//     { year: 1990, month: 10, day: 8, dd: 8 },
//     { year: 1990, month: 11, day: 8, dd: 7 },
//     { year: 1990, month: 12, day: 7, dd: 6 },
//     { year: 1991, month: 1, day: 6, dd: 4 }
// ]

八字干支

console.log(gzi(2021, 11, 11, 15))
// {
//     g: [ 7, 5, 9, 6 ], // 天干
//     z: [ 1, 11, 11, 8 ], // 地址
//     jd: 2459530.125011574, // 输入日期对应的儒略历时间
//     jq: [ 2459526.0404064553, 2459555.747754251 ], // 输入日期对应的前后节气(12节气,不包含中气)
//     jqi: 10 // 对应节气的索引 0 ~ 15 (详情参考gzi方法实现)
// }

如果需要区分早晚子时,调用时加入相应参数即可gzi(2021, 11, 11, 15,0, 0, true)

console.log(plate(true,2000, 1, 1, 11)) // 未区分早晚子时
// {
//   basic: { g: [ 5, 2, 4, 4 ], z: [ 3, 0, 6, 6 ] }, // 四柱天干地址
//   lucky: { // 大运
//     desc: '8年2月6天起运',
//     g: [ // 大运天干
//       1, 0, 9, 8, 7,
//       6, 5, 4, 3, 2,
//       1, 0
//     ],
//     z: [ // 大运地支
//       11, 10, 9, 8, 7,
//        6,  5, 4, 3, 2,
//        1,  0
//     ],
//     datetime: [ // 每个大运对应的起运时间
//       '2008-01-25 11:49:00',
//       '2017-12-03 11:49:00',
//       '2027-10-12 11:49:00',
//       '2037-08-20 11:49:00',
//       '2047-06-29 11:49:00',
//       '2057-05-07 11:49:00',
//       '2067-03-16 11:49:00',
//       '2077-01-22 11:49:00',
//       '2086-12-01 11:49:00',
//       '2096-10-09 11:49:00',
//       '2106-08-19 11:49:00',
//       '2116-06-27 11:49:00'
//     ]
//   },
//   shiren: { datetime: '2008-02-04 19:00:31', year: 2008 }, // 实仁算法的大运起运年及时间
//   birth: { // 输入日期对应的前后节气名称及时间
//     front: { name: '大雪', time: '1999-12-07 21:47:36' },
//     back: { name: '小寒', time: '2000-01-06 09:01:02' }
//   }
// }

四柱干支转公历日期时间范围

// 
乙亥/己丑/丙辰/壬辰
console.log(gz2datetime(11, 25, 52, 28))
[
  [ [ 1516, 1, 7, 7, 0, 0 ], [ 1516, 1, 7, 9, 0, 0 ] ],
  [ [ 1696, 2, 1, 7, 0, 0 ], [ 1696, 2, 1, 9, 0, 0 ] ],
  [ [ 1756, 1, 18, 7, 0, 0 ], [ 1756, 1, 18, 9, 0, 0 ] ],
  [ [ 1936, 2, 4, 7, 0, 0 ], [ 1936, 2, 4, 9, 0, 0 ] ],
  [ [ 1996, 1, 20, 7, 0, 0 ], [ 1996, 1, 20, 9, 0, 0 ] ],
  [ [ 2236, 1, 22, 7, 0, 0 ], [ 2236, 1, 22, 9, 0, 0 ] ],
  [ [ 2296, 1, 7, 7, 0, 0 ], [ 2296, 1, 7, 9, 0, 0 ] ],
  [ [ 2476, 1, 23, 7, 0, 0 ], [ 2476, 1, 23, 9, 0, 0 ] ]
]