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

tiger-calendar

v1.0.5

Published

基于 Taro 小程序的自定义日历插件

Downloads

3

Readme

基于 Taro 小程序的自定义日历插件

使用方法

1. /*安装*/ npm i tiger-calendar -S

2. /*引入*/ import { Calendar } from "tiger-calendar";

3. /*使用*/ <Calendar {...oprions} />

API

type 日历类型

指定日历切换方式<必填>: 点击切换 || 滑动切换

default: normal (点击切换)

  • type: String
  • value: 'normal' | 'scroll'
  • example:
<Calendar type="normal" />
titleOpt 年月标题配置

指定日历标题自定义配置<可选>

default: xxxx年 xx月

  • type: Object

  • value: { template: Str, style: Object }

    • template:

      "Ayear Bmonth" 最终渲染时会将A和B分别替换成具体的时间year和month分别替换成年和月

    • style:

      指定日历标题的具体样式 请按照react中行内样式的书写方式

  • example:

<Calendar
  titleOpt={{
    template: "Ayear-Bmonth",
    style: {
      color: "rgba(51, 51, 51, 1)",
      fontSize: "28rpx",
      ...
    }
  }}
/>
weekOpt 七天周末标题配置

指定七天周末标题自定义配置<可选>

default: 日, 一, 二, 三, 四, 五, 六

  • type: Object

  • value: { data: Arr, style: Object }

    • data:

      ["日", "一", "二", "三", "四", "五", "六"] 提供一个length7的一维数组

    • style:

      指定七天周末标题的具体样式 请按照react中行内样式的书写方式

  • example:

<Calendar
  weekOpt={{
    data: ["7", "1", "2", "3", "4", "5", "6"],
    style: {
      color: "rgba(153, 153, 153, 1)",
      fontSize: "28rpx",
      ...
    }
  }}
/>
dayOpt 天的样式配置

指定不同状态下天的自定义样式配置<可选>

default: 20 21 2223 24 25 26

  • type: Object

  • value: { defaultStyle: Object, todayStyle: Object, currentMonthStyle: Object, clickedStyle: Object }

    • defaultStyle:

      的默认样式, 在没有任何状态下的样式显示状态 按照react中行内样式的书写方式

    • todayStyle:

      今天 的默认样式, 今天特定状态下的样式显示状态 按照react中行内样式的书写方式

    • currentMonthStyle:

      当前月显示样式, 仅在 scroll 状态下有效 按照react中行内样式的书写方式

    • clickedStyle:

      的点击样式, 在点击后的样式显示状态 按照react中行内样式的书写方式

  • example:

<Calendar
  dayOpt={{
      defaultStyle: {
        fontSize: "26rpx",
        ...
      },
      todayStyle: {
        color: "#fff",
        ...
      },
      currentMonthStyle: {
        fontSize: "25rpx",
        ...
      },
      clickedStyle: {
        color: "#fff",
        ...
      }
    }}
/>
dotOpt 标记点的配置

指定标记点的自定义配置<可选>

default: 20.22 23.25 26.

  • type: Arr

  • value: [{ color: Str, date: Str }, ...]

    • color:

      指定的颜色, 支持: rgb 十六进制 颜色名

    • date:

      指定的日期 确定什么时间显示该

  • example:

<Calendar
  dotOpt={[
    { color: "#00B6BA", date: "2019-9-25" },
    { color: "red", date: "2019-10-25" }
  ]}
/>
onSelectDay 天的点击事件

点击后的回调 参数是点击的时间对象 包含{年, 月, 日} <可选>

default: {day: 5, year: 2019, month: 10}

  • type: Func

  • example:

<Calendar
  onSelectDay={date => {
    console.log("clicked-date:", date);
  }}
/>
Tip
    1. 仅测试小程序端 其他端没有进行测试
    1. 目前仅支持 TS 项目

homepage

https://github.com/funky-tiger/tiger-calendar/blob/master/README.md

issues

https://github.com/funky-tiger/tiger-calendar/issues