]> git.immae.eu Git - github/fretlink/time-picker.git/commitdiff
Fixing formatting in 12hours example
authorAntony Shaleynikov <shaleynikov@gmail.com>
Mon, 6 Mar 2017 14:56:48 +0000 (17:56 +0300)
committerAntony Shaleynikov <shaleynikov@gmail.com>
Mon, 6 Mar 2017 14:56:48 +0000 (17:56 +0300)
examples/12hours.js

index 16e428d4150b4e8a4f33ac3730265f32a7ca36be..72d6950027d997da0fabf0870889e4057585106a 100644 (file)
@@ -9,22 +9,21 @@ import moment from 'moment';
 
 import TimePicker from 'rc-time-picker';
 
-const showSecond = false;
-const str = showSecond ? 'h:mm a' : 'h:mm a';
+const format = 'h:mm a';
 
 const now = moment().hour(0).minute(0);
 
 function onChange(value) {
-  console.log(value && value.format(str));
+  console.log(value && value.format(format));
 }
 
 ReactDom.render(
   <TimePicker
-    showSecond={showSecond}
+    showSecond={false}
     defaultValue={now}
     className="xxx"
     onChange={onChange}
-    format={str}
+    format={format}
     use12Hours
   />,
   document.getElementById('__react-content')