]> git.immae.eu Git - github/fretlink/time-picker.git/blame - README.md
Merge pull request #29 from fehnomenal/fix-ref-error
[github/fretlink/time-picker.git] / README.md
CommitLineData
e75ed0c6 1# TimePicker
78637ac0
M
2
3React TimePicker
4
e9060dda 5[![NPM version][npm-image]][npm-url]
6[![build status][travis-image]][travis-url]
7[![Test coverage][coveralls-image]][coveralls-url]
8[![gemnasium deps][gemnasium-image]][gemnasium-url]
9[![node version][node-image]][node-url]
10[![npm download][download-image]][download-url]
11
12[npm-image]: http://img.shields.io/npm/v/rc-time-picker.svg?style=flat-square
13[npm-url]: http://npmjs.org/package/rc-time-picker
14[travis-image]: https://img.shields.io/travis/react-component/time-picker.svg?style=flat-square
15[travis-url]: https://travis-ci.org/react-component/time-picker
16[coveralls-image]: https://img.shields.io/coveralls/react-component/time-picker.svg?style=flat-square
17[coveralls-url]: https://coveralls.io/r/react-component/time-picker?branch=master
18[gemnasium-image]: http://img.shields.io/gemnasium/react-component/time-picker.svg?style=flat-square
19[gemnasium-url]: https://gemnasium.com/react-component/time-picker
20[node-image]: https://img.shields.io/badge/node.js-%3E=_4.0.0-green.svg?style=flat-square
21[node-url]: http://nodejs.org/download/
22[download-image]: https://img.shields.io/npm/dm/rc-time-picker.svg?style=flat-square
23[download-url]: https://npmjs.org/package/rc-time-picker
24
25example
26--------
27
28http://react-component.github.io/time-picker/
29
78637ac0
M
30install
31-------
32
33```
34npm install rc-time-picker
35```
36
37Usage
38-----
39
40```
41import TimePicker from 'rc-time-picker';
78637ac0
M
42import ReactDOM from 'react-dom';
43ReactDOM.render(<TimePicker />, container);
44```
45
46API
47---
48
4acbf95c 49### TimePicker
78637ac0 50
518b852e
M
51| Name | Type | Default | Description |
52|-------------------------|-----------------------------------|-----------------------------------------------|--------------------------------------------------------------------------------------------|
53| prefixCls | String | | prefixCls of this component |
4984ed85 54| clearText | String | 'clear' | |
518b852e 55| disabled | Boolean | false | whether picker is disabled |
4984ed85 56| clearText | String | clear | clear text |
518b852e 57| open | Boolean | false | current open state of picker. controlled prop |
4984ed85 58| defaultValue | moment | null | default initial value |
59| defaultOpenValue | moment | moment() | default open panel value, used to set utcOffset,locale if value/defaultValue absent |
60| value | moment | null | current value |
518b852e
M
61| placeholder | String | '' | time input's placeholder |
62| showHour | Boolean | whether show hour | |
37c36c09 63| showMinute | Boolean | whether show minute | |
518b852e 64| showSecond | Boolean | whether show second | |
4984ed85 65| format | String | | |
bec70d57
M
66| disabledHours | Function | disabled hour options | |
67| disabledMinutes | Function | disabled minute options | |
68| disabledSeconds | Function | disabled second options | |
518b852e
M
69| hideDisabledOptions | Boolean | whether hide disabled options | |
70| onChange | Function | null | called when select a different value |
b86fe1d1 71| addon | Function | nothing | called from timepicker panel to render some addon to its bottom, like an OK button. Receives panel instance as parameter, to be able to close it like `panel.close()`.|
518b852e
M
72| placement | String | bottomLeft | one of ['left','right','top','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'] |
73| transitionName | String | '' | |
679773bb 74| name | String | nothing | sets the name of the generated input |
78637ac0 75
4984ed85 76
77## Test Case
78
79```
80npm test
81npm run chrome-test
82```
83
84## Coverage
85
86```
87npm run coverage
88```
89
90open coverage/ dir
91
78637ac0
M
92License
93-------
94
95rc-time-picker is released under the MIT license.