]> git.immae.eu Git - github/fretlink/time-picker.git/blob - examples/12hours.js
Ignore lock files
[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 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 );