]> git.immae.eu Git - github/fretlink/time-picker.git/blob - examples/12hours.js
18fb626d484ec828bcbfdf5bd885fd8f73081956
[github/fretlink/time-picker.git] / examples / 12hours.js
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 showSecond = false;
13 const str = showSecond ? 'HH:mm:ss' : 'HH:mm';
14
15 const now = moment().hour(14).minute(30);
16
17 function onChange(value) {
18 console.log(value && value.format(str));
19 }
20
21 ReactDom.render(
22 <TimePicker
23 showSecond={showSecond}
24 defaultValue={now}
25 className="xxx"
26 onChange={onChange}
27 show12Hours
28 />,
29 document.getElementById('__react-content')
30 );