-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.md~
90 lines (61 loc) · 1.85 KB
/
README.md~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# react-moment-datepicker
React calendar bound to moment for the locale data and timezones handling
## How to
### Install
`npm i react-moment-datepicker`
### Peer dependencies
```JSON
{
"classnames": "2.2.5",
"moment": "2.14.1",
"moment-timezone": "0.5.5",
"react": "15.3.1",
"react-addons-css-transition-group": "15.3.1",
"react-popover": "0.4.4"
}
```
### API
#### `DatePicker.propTypes`
```JS
{
// which month when no date
defaultDate: momentPropTypes.momentObj,
// current value
date: momentPropTypes.momentObj,
// current timezone if not the moment default one
timezone: React.PropTypes.string,
// overridable component for day cells
DayComponent: React.PropTypes.func,
// format for the date in the header (basically month and year)
headerFormat: React.PropTypes.string,
// format for the default date in the footer
footerFormat: React.PropTypes.string,
// calendar wrapped in a popover by default, inlined if inline prop is true
inline: React.PropTypes.bool,
// options passed to the popover component
popoverOptions: React.PropTypes.object,
// selection handler (basically update the date then provided as prop)
onSelect: React.PropTypes.func
}
```
#### Component's exposed methods
To access components exposed methods, refer to the [Expose Component Functions](https://facebook.github.io/react/tips/expose-component-functions.html) from the official documentation.
```JS
// show the datepicker
this.refs.datepicker.show();
// hide the datepicker
this.refs.datepicker.hide();
```
## Contribute
### Start
```
git clone [email protected]:atondelier/react-moment-datepicker.git
cd react-moment-datepicker
npm install
npm start
```
Go to `localhost:8080`
### Build
`npm run build`
## Credits
Written for [lafourchette](https://github.com/lafourchette) organization.