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

@gem-mine/rmc-calendar

v1.0.8

Published

React Mobile Calendar Component(web and react-native)

Downloads

41

Readme

rmc-calendar


React Mobile Calendar Component (web)

NPM version react Test coverage npm download

Screenshots

Development

npm i 
npm start

Example

http://localhost:8021/examples/

online example: http://gem-mine.github.io/rmc-calendar/

install

rmc-calendar

docs

Usage

import React, { Component } from 'react';

import { RMCCalendar } from '@gem-mine/rmc-calendar';
import '@gem-mine/rmc-calendar/assets/index.css';

class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      visible: false,
    };
  }

  setVisiable = () => {
    this.setState({
      visible: !this.state.visible,
    });
  }

  render() {
    return (
      <div className="App">
        <Calendar
          visible={this.state.visible}
          onCancel={this.setVisiable}
          onOk={this.setVisiable}
        />
      </div>
    );
  }
}

export default App;

API

Calendar props

interface PropsType {
    /** 本地化 */
  locale?: Models.Locale;
  /** 关闭时回调 */
  onCancel?: () => void;
  /** 清除时回调 */
  onClear?: () => void;
  /** 确认时回调 */
  onOk?: (startDateTime?: Date, endDateTime?: Date) => void;
  /** (web only) 样式前缀,default: rmc-calendar */
  prefixCls?: string;
  /** 附加样式名称, default: '' */
  className?: string;
  style?: React.CSSProperties;
  /** header title, default: {locale.title} */
  title?: string;
  /** 选择类型,default: range,one: 单日,range: 日期区间 */
  type?: 'one' | 'range';
  /** 是否显示,default: false */
  visible?: boolean;
  /** 选中日期, 开始时间, 结束时间 */
  value?: SelectDateType;
  /** 默认展示,开始时间、结束时间 */
  defaultValue?: SelectDateType;
  /** 是否采用滑动翻页模式 */
  swiper?: boolean;
  /** 是否在日期区间模式显示起/止信息 */
  showBeginEndInfo?: boolean;

  // CalendarPanel
  /** 显示开始日期,default: today */
  defaultDate?: Date;
  /** 自定义内容追加到单元格内 */
  renderDateCellExtra?: (date: Date) => Models.ExtraData | void;
  /** 自定义内容覆盖单元格 */
  renderDateFullCell?: (data: Models.CellData) => React.ReactNode | void;
  /** 自定义确认框 */
  renderConfirm?: (data?: Models.ConfirmParams) => Models.ConfirmPanelData;
  /** 无限滚动优化(大范围选择),default: false */
  infinite?: boolean;
  /** 初始化月个数,default: 6 */
  initalMonths?: number;
  /** 可显示日期 */
  validRange?: [Date | undefined, Date | undefined];
  /** 不可选日期 */
  disabledDate?: (current: Date) => boolean;
  /** 设置月起始日(1-28),default: 1 */
  firstDayOfMonth?: number;
  /** 设置周起始日(0-6),default: 0 */
  firstDayOfWeek?: number;
  /** 选择日期回调,如果有返回值,选择范围将使用返回值 */
  onSelect?: (date: Date, state?: [Date | undefined, Date | undefined]) => SelectDateType | void;
}

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rmc-calendar is released under the MIT license.