aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authoryiminghe <yiminghe@gmail.com>2015-11-27 16:15:05 +0800
committeryiminghe <yiminghe@gmail.com>2015-11-27 16:15:05 +0800
commit8133e8cf3b37b2be764616493ade7c7a7678fce1 (patch)
tree4321352889ab62f18ff8703adac8756ddb506dc0 /examples
parent7702bb67968104a64fa85ba7e893bf2393eeb3c5 (diff)
downloadtime-picker-8133e8cf3b37b2be764616493ade7c7a7678fce1.tar.gz
time-picker-8133e8cf3b37b2be764616493ade7c7a7678fce1.tar.zst
time-picker-8133e8cf3b37b2be764616493ade7c7a7678fce1.zip
add gregorianCalendarLocale prop1.0.0-alpha1
Diffstat (limited to 'examples')
-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