https://github.com/rwson/reactdatepicker
📅ReactDatePicker Component build with React
https://github.com/rwson/reactdatepicker
Last synced: 3 months ago
JSON representation
📅ReactDatePicker Component build with React
- Host: GitHub
- URL: https://github.com/rwson/reactdatepicker
- Owner: rwson
- Created: 2016-09-13T14:13:31.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-13T14:35:25.000Z (almost 10 years ago)
- Last Synced: 2025-03-05T16:23:14.824Z (over 1 year ago)
- Language: JavaScript
- Size: 535 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### ReactDatePicker
📅
React时间选择组件
#### ScreenShoot
#### Usage
npm install ReactDatePicker --save
// ...
// ES6
import React, { Component } from "react";
import ReactDOM from "react-dom";
import ReactDatePicker from "ReactDatePicker";
class App extends Component {
constructor(props) {
super(props);
}
handleDateChange(date) {
// ...
}
handleClose(date) {
// ...
}
render() {
const config = {
initDate: "2016-09-12",
format: "YYYY-mm-dd",
onClose: this.handleClose.bind(this),
onChange: this.handleDateChange.bind(this)
};
return (
);
}
}
#### API
属性名 | 意义 | 类型 | 默认 | 是否必须
---|---|---|---|---
el | 选择器(input框的class/id之类的) | String | N/A | 是
trigger | 在什么事件下显示选择器 | Array.<String> | N/A | 是
initDate | 默认时间 | Date/String | N/A | 是
format | 输出时间的格式 | String | N/A | 是
onOpen | 时间选择器刚显示的回调 | Fnnction | N/A | 否
onClose | 时间选择器关闭后的回调 | Fnnction | N/A | 否
onChange | 选择时间发生变化的回调 | Fnnction | N/A | 否