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

@muguilin/calendar

v1.0.1

Published

calendar.js, JavaScript日历插件, JavaScript日历转换库

Downloads

7

Readme

calendar - JavaScript 日历插件、日历转换库

MIT License

JavaScript 日历插件、日历转换库

中国农历(阴阳历)和西元阳历即公历互转JavaScript库 js-calendar-converter

下载安装:

# 使用npm命令下载安装
$ npm i @muguilin/calendar

# 使用yarn命令下载安装
$ yarn add @muguilin/calendar

使用实例:

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>JavaScript 日历、转换库</title>
  <style>
    body { padding: 50px; }
    section {  margin: 50px auto; width: 1200px; }
    h1{ text-align: center; }
    #el { margin: auto; padding: 20px; width: 500px; height: 310px; border: 1px solid gray; overflow: auto;}
    #el table{ width: 100%; text-align: center; }
    .now{ background-color: blue; color: #fff; }
    button { font-size: 16px; }
  </style>
</head>

<body>
  <h1>JavaScript 日历、转换库</h1>
  <hr />

  <section>
    
    <h1 id="toDay"></h1>

    <main>
        <!--<button type="button" id="perv">上一月</button>
        <button type="button" id="next">下一月</button>-->
        <div id="calendar"> </div>
       
    </main>

  </section>

  <script type="module">
    import { muCalendar, solar2lunar, lunar2solar } from '@muguilin/calendar';
	
    // 日历
    {
        const calendar = muCalendar(document.querySelector('#calendar'));

        console.log(calendar);
    }   

    // 转换
    {
        console.log('公历年月日转农历数据:', solar2lunar());

        const {Animal, gzYear, cYear, cMonth, cDay, ncWeek, IMonthCn, IDayCn} = solar2lunar();
        
        console.log('农历年月日转公历年月日:', lunar2solar(cYear, cMonth, cDay));

        toDay.innerHTML = `${Animal}【${gzYear}】,国历:${cYear}年${cMonth}月${cDay}日 ${ncWeek} ,农历:${IMonthCn} ${IDayCn}`

    };

  </script>

</body>

</html>