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

@happyma/rm_calendar

v1.1.0

Published

react mobile calendar

Downloads

5

Readme

rm-calendar

react mobile calendar

gif

注意

这个组件是基于@longlongago2/rm_calendar进行修改,
下面的readme也是@longlongago2/rm_calendar的

NPM

install

npm install @longlongago2/rm_calendar --save

usage

import React, { Component } from 'react';
import RMCalendar from '@longlongago2/rm-calendar';
import '@longlongago2/rm_calendar/dist/rm-calendar.css';

class App extends Component {
  render() {
    return (
      <RMCalendar
          defaultDate={new Date()}
          type="month"
          touch
          width="100%"
          locale="zh-cn"
          firstDayOfWeek={0}
          toolbar
        />
    );
  }
}

CDN

download

rm-calendar.zip (click to download)

usage

// css
<link rel="stylesheet" href="[path]/dist/rm-calendar.css">

// js
<script src="[path]/dist/rm-calendar.js"></script>

// html
<RMCalendar.default
    defaultDate={new Date()}
    type="month"
    touch
    width="100%"
    locale="zh-cn"
    firstDayOfWeek={0}
    toolbar
  />

API

props

| Props | Description | Type | Default | | :------ | :------ | :------: | :------: | | defaultDate | 默认时间 | Date | new Date() | | type | 日历类型 | "month"|"week" | "month" | | touch | 是否可滑动 | Boolen | true | | width | 日历宽度 | String | "100%" | | locale | 语言区 | String | "zh-cn" | | firstDayOfWeek | 周起始日[周日-周六] | [0-6] | 0 | | schedule | 日程数据 | Array | [] | | toolbar | 顶部工具栏 | Boolen | true |

events

| Events | Description | Usage | | :------ | :------ | :------: | | onCellClick | 日期单元格点击事件 | (item) => {} | | onPageChange | 翻页事件 | ({ year, month }) => {} |

methods

| Methods | Description | Params | | :------ | :------ | :------: | | turnWeekNumToChar | 周数字转汉字,参数:0-6 | day :Integer | | getDaysOfPerMonth | 获取每个月的天数,参数:日期 | date :Date | | getDataOfHeader | 获取表头周数据, 参数:周起始日(0-6) | firstDayOfWeek: Number | | getComposeDaysOfBoard | 获取面板组成天数据,参数1:date日期,参数2:周起始日,参数3:查询部分[-1:获取上月组成天数, 0:获取本月组成天数, 1:获取下月组成天数] | date: Date, firstDayOfWeek: Number, order: Number | | getDataOfBoard | 获取面板所有日期数据,参数1:日期,参数2:周起始日 | date: Date, firstDayOfWeek: Number | | getWeekRowOfBoard | 获取日期所在面板中的行数,参数1:日期,参数2:周起始日 | date: Date, firstDayOfWeek: Number | | getComputedDataOfBoard | 获取合成日程表数据的日期面板数据,参数1:日期,参数2:周起始日期,日程表数据 | date: Date, firstDayOfWeek: Number, schedule: Array | | dateToValid | 校正日期1900-2099,大于或小于正常数据范围自动纠正 | date: Date |