aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorAntony Shaleynikov <shaleynikov@gmail.com>2017-03-06 17:56:48 +0300
committerAntony Shaleynikov <shaleynikov@gmail.com>2017-03-06 17:56:48 +0300
commit5423edb11fac7f8ed5d35ba739878ee4435fa5af (patch)
tree248500f50c3783a8bd3837c33d97fde5a3f83a0c /examples
parentc1b40cabff82ed1b7a24fd9baf74e7a8e64119e5 (diff)
downloadtime-picker-5423edb11fac7f8ed5d35ba739878ee4435fa5af.tar.gz
time-picker-5423edb11fac7f8ed5d35ba739878ee4435fa5af.tar.zst
time-picker-5423edb11fac7f8ed5d35ba739878ee4435fa5af.zip
Fixing formatting in 12hours example
Diffstat (limited to 'examples')
-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')