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 🙏

© 2025 – Pkg Stats / Ryan Hefner

dfh-calender

v1.0.4

Published

calender prince

Readme

前言

本日历参考文章:https://blog.csdn.net/BetterGG/article/details/80570183

日历在参考文献上进行了修改,使用JS+HTML+ES6/7,并对日历进行了进一步封装,使其使用更加方便,同时对样式进行了可配置化,用户可以通过自己的需求来修改需要的样式

项目效果:

calender.gif

使用

    1. 引入依赖
npm install dfh-calender
    1. 使用
<!--
 * @Author: dfh
 * @Date: 2020-05-18 11:15:28
 * @LastEditors: dfh
 * @LastEditTime: 2020-05-18 11:17:42
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="./node_modules/dfh-calender/css/common.css" />
    <link
      rel="stylesheet"
      href="./node_modules/dfh-calender/css/calender.css"
    />
    <style></style>
  </head>
  <body>
    <div class="calender"></div>
  </body>
  <script src="./node_modules/dfh-calender/lib/calender.js"></script>
  <script>
    var arrayJSON = [
      {
        id: "0",
        date: "2020-04-29",
        price: "¥123"
      },
      {
        id: "1",
        date: "2020-04-30",
        price: "¥123"
      },
      {
        id: "2",
        date: "2020-04-31",
        price: "¥123"
      },
      {
        id: "3",
        date: "2020-05-01",
        price: "¥123"
      },
      {
        id: "4",
        date: "2020-05-02",
        price: "¥123"
      },
      {
        id: "5",
        date: "2020-05-03",
        price: "¥123"
      },
      {
        id: "6",
        date: "2020-05-04",
        price: "¥123"
      },
      {
        id: "7",
        date: "2020-05-05",
        price: "¥123"
      },
      {
        id: "8",
        date: "2020-05-06",
        price: "¥123"
      },
      {
        id: "9",
        date: "2020-05-07",
        price: "¥123"
      },
      {
        id: "10",
        date: "2020-05-08",
        price: "¥123"
      },
      {
        id: "11",
        date: "2020-05-09",
        price: "¥123"
      },
    ];
    new Calender({
      element: document.querySelector(".calender"), //父控件
      bgColor: "#eb8300", // 默认选中后的背景颜色
      color: "#fff", //默认选择文字颜色
      unClickTxtColor: "red", //不能选择的字体颜色
      arrayJSON: arrayJSON, //价格数据
      delay: 3, //延迟几天可以选择
      headerBgColor: "skyBlue", //星期背景色
      weekendTxtColor: "red", //周六周日文字眼色
      workDayTxtColor: "green", //工作日文字眼色
      index: 5, //默认展示几个月份
      bgCalender: "skyBlue", //日历背景色
      callback: function (e) {
        console.log(e);
      },
    });
  </script>
</html>

属性

| 属性 | 类型 | 描述 | 默认值 | | :-------------: | :------: | :-----------------------------------------------: | :------: | | element | DOM | 需要添加到的DOM元素 | false | | bgColor | String | 选中后的背景颜色 | #eb8300 | | color | String | 选中的文字颜色 | #ffd101 | | unClickTxtColor | String | 不能选择的字体颜色 | #ccc | | arrayJSON | Array | 传递的数据 | [] | | delay | Int | 延迟几天可以选择 | 4 | | headerBgColor | String | 日期的背景色 | white | | weekendTxtColor | String | 周六周日的文字颜色 | #ffd101 | | workDayTxtColor | String | 周一到周五的文字颜色 | black | | index | Int | 展示几个月份的 | 4 | | bgCalender | String | 日历背景色 | white | | callback | Function | 选中时的回调返回值:{date:“”,id:“”,price:“”} | |