npm install react-date-picker-vnReact 日期组件。
Demo:chenxsan.github.io/react-date-picker-cs
You can install it from npm:
```
npm install react-date-picker-cs --save
If you use jspm, then:
``
jspm install npm:react-date-picker-csimport DatePicker from 'react-date-picker-cs'
then where you want to use.
You can also link to dist/react-date-picker-cs.js and dist/ReactDatePicker.css in your HTML directly if you don't use some tools like browserify or webpack or jspm。
`
var React = require('react');
var ReactDatePicker = require('react-date-picker-cs');
var App = React.createClass({
getInitialState: function() {
return {
selectedDate: '2015-07-20'
};
},
log: function(date) {
this.setState({
selectedDate: date
});
},
render () {
return (
React.render(
`
* range {Array} - You can customize the range of year
* onChange {Function} - When user set a date
* locale {String} - Defaults to en, you can also use zhfalse
* disabled {Boolean} - Defaults to , you can pass in true to disable component
* value {String} - Set a default date
The styles are defined in ReactDatePicker.less, make use of BEM naming convention。
I had only test it with the latest Firefox、Chrome and Safari on Mac OSX.
The source code is in src folder, so you can customize it as you like.
Anything related to developing this component, please check JedWatson/generator-react-component.
Test code is in test folder, you can run:
```
npm test
MIT. Copyright (c) 2015 Sam Chen.