diff options
author | MG12 <wuzhao.mail@gmail.com> | 2015-11-17 22:16:15 +0800 |
---|---|---|
committer | MG12 <wuzhao.mail@gmail.com> | 2015-11-17 22:16:15 +0800 |
commit | 4acbf95c7d2693d73b0c8c021ad892b6529d4c06 (patch) | |
tree | 1e1780ba90895d8f5901472a7c67a77186741a4f /examples/pick-time.js | |
parent | 78637ac02ce6a469d2021736d3cb12e98c5edbe7 (diff) | |
download | time-picker-4acbf95c7d2693d73b0c8c021ad892b6529d4c06.tar.gz time-picker-4acbf95c7d2693d73b0c8c021ad892b6529d4c06.tar.zst time-picker-4acbf95c7d2693d73b0c8c021ad892b6529d4c06.zip |
Diffstat (limited to 'examples/pick-time.js')
-rw-r--r-- | examples/pick-time.js | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/examples/pick-time.js b/examples/pick-time.js index 8c6b826..54548c7 100644 --- a/examples/pick-time.js +++ b/examples/pick-time.js | |||
@@ -8,7 +8,6 @@ import DateTimeFormat from 'gregorian-calendar-format'; | |||
8 | import zhCn from 'gregorian-calendar/lib/locale/zh_CN'; | 8 | import zhCn from 'gregorian-calendar/lib/locale/zh_CN'; |
9 | 9 | ||
10 | import TimePicker from 'rc-time-picker/src/TimePicker'; | 10 | import TimePicker from 'rc-time-picker/src/TimePicker'; |
11 | import TimePanel from 'rc-time-picker/src/TimePanel'; | ||
12 | import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; | 11 | import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; |
13 | 12 | ||
14 | const formatter = new DateTimeFormat('HH:mm:ss'); | 13 | const formatter = new DateTimeFormat('HH:mm:ss'); |
@@ -16,22 +15,7 @@ const formatter = new DateTimeFormat('HH:mm:ss'); | |||
16 | const now = new GregorianCalendar(zhCn); | 15 | const now = new GregorianCalendar(zhCn); |
17 | now.setTime(Date.now()); | 16 | now.setTime(Date.now()); |
18 | 17 | ||
19 | const timePanel = ( | ||
20 | <TimePanel | ||
21 | defaultValue={now} | ||
22 | locale={TimePickerLocale} | ||
23 | formatter={formatter} | ||
24 | minuteOptions={[0, 30]} | ||
25 | /> | ||
26 | ); | ||
27 | |||
28 | ReactDom.render( | 18 | ReactDom.render( |
29 | <TimePicker panel={timePanel} value={now}> | 19 | <TimePicker formatter={formatter} locale={TimePickerLocale} value={now} />, |
30 | { | ||
31 | ({value}) => { | ||
32 | return <input type="text" placeholder="请选择时间" readOnly value={value && formatter.format(value)} />; | ||
33 | } | ||
34 | } | ||
35 | </TimePicker>, | ||
36 | document.getElementById('__react-content') | 20 | document.getElementById('__react-content') |
37 | ); | 21 | ); |