diff options
author | yiminghe <yiminghe@gmail.com> | 2015-11-27 16:15:05 +0800 |
---|---|---|
committer | yiminghe <yiminghe@gmail.com> | 2015-11-27 16:15:05 +0800 |
commit | 8133e8cf3b37b2be764616493ade7c7a7678fce1 (patch) | |
tree | 4321352889ab62f18ff8703adac8756ddb506dc0 /examples | |
parent | 7702bb67968104a64fa85ba7e893bf2393eeb3c5 (diff) | |
download | time-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.js | 13 |
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'; | |||
10 | import TimePicker from 'rc-time-picker'; | 10 | import TimePicker from 'rc-time-picker'; |
11 | import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; | 11 | import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; |
12 | 12 | ||
13 | const formatter = new DateTimeFormat('HH:mm:ss'); | 13 | var showSecond = true; |
14 | var str = showSecond ? 'HH:mm:ss' : 'HH:mm'; | ||
15 | |||
16 | const formatter = new DateTimeFormat(str); | ||
14 | 17 | ||
15 | const now = new GregorianCalendar(zhCn); | 18 | const now = new GregorianCalendar(zhCn); |
16 | now.setTime(Date.now()); | 19 | now.setTime(Date.now()); |
@@ -20,6 +23,12 @@ function onChange(value) { | |||
20 | } | 23 | } |
21 | 24 | ||
22 | ReactDom.render( | 25 | ReactDom.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 | |||
34 | console.log(zhCn); \ No newline at end of file | ||