diff options
author | afc163 <afc163@gmail.com> | 2017-03-08 15:00:31 +0800 |
---|---|---|
committer | afc163 <afc163@gmail.com> | 2017-03-08 15:00:31 +0800 |
commit | 4e020febdf6201ab5f10a0e49be81c6ff32daaeb (patch) | |
tree | e5636fff22c61a93236e4a7dfe1e00e87d371061 /examples | |
parent | 19b96283c09e678b8b7ea5c60569996a0bab5935 (diff) | |
parent | 369ffb9a3883cb01ff5d80cc2312a1a7f2fbe6a4 (diff) | |
download | time-picker-4e020febdf6201ab5f10a0e49be81c6ff32daaeb.tar.gz time-picker-4e020febdf6201ab5f10a0e49be81c6ff32daaeb.tar.zst time-picker-4e020febdf6201ab5f10a0e49be81c6ff32daaeb.zip |
Merge branch 'shaleynikov-master'
Diffstat (limited to 'examples')
-rw-r--r-- | examples/12hours.html | 0 | ||||
-rw-r--r-- | examples/12hours.js | 30 |
2 files changed, 30 insertions, 0 deletions
diff --git a/examples/12hours.html b/examples/12hours.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/examples/12hours.html | |||
diff --git a/examples/12hours.js b/examples/12hours.js new file mode 100644 index 0000000..72d6950 --- /dev/null +++ b/examples/12hours.js | |||
@@ -0,0 +1,30 @@ | |||
1 | /* eslint no-console:0 */ | ||
2 | |||
3 | import 'rc-time-picker/assets/index.less'; | ||
4 | |||
5 | import React from 'react'; | ||
6 | import ReactDom from 'react-dom'; | ||
7 | |||
8 | import moment from 'moment'; | ||
9 | |||
10 | import TimePicker from 'rc-time-picker'; | ||
11 | |||
12 | const format = 'h:mm a'; | ||
13 | |||
14 | const now = moment().hour(0).minute(0); | ||
15 | |||
16 | function onChange(value) { | ||
17 | console.log(value && value.format(format)); | ||
18 | } | ||
19 | |||
20 | ReactDom.render( | ||
21 | <TimePicker | ||
22 | showSecond={false} | ||
23 | defaultValue={now} | ||
24 | className="xxx" | ||
25 | onChange={onChange} | ||
26 | format={format} | ||
27 | use12Hours | ||
28 | />, | ||
29 | document.getElementById('__react-content') | ||
30 | ); | ||