]> git.immae.eu Git - github/fretlink/time-picker.git/blame_incremental - examples/pick-time.js
Merge pull request #72 from marekpiechut/picker-step
[github/fretlink/time-picker.git] / examples / pick-time.js
... / ...
CommitLineData
1/* eslint no-console:0 */
2
3import 'rc-time-picker/assets/index.less';
4
5import React from 'react';
6import ReactDom from 'react-dom';
7
8import moment from 'moment';
9
10import TimePicker from 'rc-time-picker';
11
12const showSecond = true;
13const str = showSecond ? 'HH:mm:ss' : 'HH:mm';
14
15
16function onChange(value) {
17 console.log(value && value.format(str));
18}
19
20ReactDom.render(
21 <TimePicker
22 style={{ width: 100 }}
23 showSecond={showSecond}
24 defaultValue={moment()}
25 className="xxx"
26 onChange={onChange}
27 />,
28 document.getElementById('__react-content')
29);