aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/12hours.js
diff options
context:
space:
mode:
Diffstat (limited to 'examples/12hours.js')
-rw-r--r--examples/12hours.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/12hours.js b/examples/12hours.js
index 16e428d..72d6950 100644
--- a/examples/12hours.js
+++ b/examples/12hours.js
@@ -9,22 +9,21 @@ import moment from 'moment';
9 9
10import TimePicker from 'rc-time-picker'; 10import TimePicker from 'rc-time-picker';
11 11
12const showSecond = false; 12const format = 'h:mm a';
13const str = showSecond ? 'h:mm a' : 'h:mm a';
14 13
15const now = moment().hour(0).minute(0); 14const now = moment().hour(0).minute(0);
16 15
17function onChange(value) { 16function onChange(value) {
18 console.log(value && value.format(str)); 17 console.log(value && value.format(format));
19} 18}
20 19
21ReactDom.render( 20ReactDom.render(
22 <TimePicker 21 <TimePicker
23 showSecond={showSecond} 22 showSecond={false}
24 defaultValue={now} 23 defaultValue={now}
25 className="xxx" 24 className="xxx"
26 onChange={onChange} 25 onChange={onChange}
27 format={str} 26 format={format}
28 use12Hours 27 use12Hours
29 />, 28 />,
30 document.getElementById('__react-content') 29 document.getElementById('__react-content')