aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/pick-time.js
diff options
context:
space:
mode:
Diffstat (limited to 'examples/pick-time.js')
-rw-r--r--examples/pick-time.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/examples/pick-time.js b/examples/pick-time.js
index 70de23d..178b622 100644
--- a/examples/pick-time.js
+++ b/examples/pick-time.js
@@ -10,7 +10,10 @@ import zhCn from 'gregorian-calendar/lib/locale/zh_CN';
10import TimePicker from 'rc-time-picker'; 10import TimePicker from 'rc-time-picker';
11import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; 11import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN';
12 12
13const formatter = new DateTimeFormat('HH:mm:ss'); 13var showSecond = true;
14var str = showSecond ? 'HH:mm:ss' : 'HH:mm';
15
16const formatter = new DateTimeFormat(str);
14 17
15const now = new GregorianCalendar(zhCn); 18const now = new GregorianCalendar(zhCn);
16now.setTime(Date.now()); 19now.setTime(Date.now());
@@ -20,6 +23,12 @@ function onChange(value) {
20} 23}
21 24
22ReactDom.render( 25ReactDom.render(
23 <TimePicker formatter={formatter} locale={TimePickerLocale} defaultValue={now} onChange={onChange}/>, 26 <TimePicker formatter={formatter} locale={TimePickerLocale}
27 showSecond={showSecond}
28 defaultValue={now}
29 onChange={onChange}/>,
24 document.getElementById('__react-content') 30 document.getElementById('__react-content')
25); 31);
32
33
34console.log(zhCn); \ No newline at end of file