npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

rc-calendar-tbtime

9.3.114 • Public • Published

rc-calendar


React Calendar(增加淘宝时间选择)

Screenshots

Feature

  • support ie9,ie9+,chrome,firefox,safari
  • support date, month, year, decade select panel
  • support week number
  • support en_US and zh_CN locale(UI), use moment.utcOffset to set timezone
  • support aria and keyboard accessibility

Keyboard

  • Previous month (PageUp)
  • Next month (PageDown)
  • tab into hour input: Last hour(Up), Next hour(Down)
  • tab into hour input: Last minute(Up), Next minute(Down)
  • tab into hour input: Last second(Up), Next second(Down)
  • Last year (Control + left)
  • Next year (Control + right)

install

npm install --save rc-calendar-tbtime

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import TbCalendar from "rc-calendar-tbtime/dist/rc-calendar";
import "rc-calendar-tbtime/dist/rc-calendar.css";
 
class Demo extends React.Component{
  constructor()
  {
    super();
    this.state = {value:"2017-12"}
  }
  handleChange(v) { this.setState({ value: v }) }
 
  render(){
    return ( <TbCalendar disabled={false}
                         onChange={(v)=>{this.handleChange(v)}}
                         value={this.state.value}
                         format="YYYY-MM"/>
 
    );
  }
 
}
 
 
ReactDOM.render(<Demo />, document.getElementById('__react-content'));

属性说明

name type description
value String 【必填】只支持受控组件,value要跟状态值绑定
format String 【可选】日期格式,如果为空默认格式为:YYYY-MM-DD HH:mm:ss
onChange function 【必填】变更函数,入参为format格式日期字符串
disabled boolean 【可选】是否只读,默认false

install

npm i rc-calendar-tbtime

Downloadsweekly downloads

51

version

9.3.114

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability