From 8d85684b124979e1f76a9fdf5d4416363c3fe6c1 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 19 Nov 2015 16:28:28 +0800 Subject: [PATCH] resume date time demo --- components/datepicker/demo/time.md | 22 +++++----------------- components/datepicker/index.md | 1 + components/timepicker/demo/basic.md | 5 +---- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/components/datepicker/demo/time.md b/components/datepicker/demo/time.md index b61100110b..d72c4de844 100644 --- a/components/datepicker/demo/time.md +++ b/components/datepicker/demo/time.md @@ -2,26 +2,14 @@ - order: 4 -和 [时间选择组件](/components/timepicker) 配合使用。 +准确到秒的时间选择面板。 --- ````jsx -import { Datepicker, Timepicker } from 'antd'; +import { Datepicker } from 'antd'; -function onDateChange(date) { - console.log(date.toLocaleDateString()); -} - -function onTimeChange(time) { - console.log(time.toLocaleTimeString()); - console.log('时', time.getHours()); - console.log('分', time.getMinutes()); - console.log('秒', time.getSeconds()); -} - -ReactDOM.render(
- - -
, document.getElementById('components-datepicker-demo-time')); +ReactDOM.render( + +, document.getElementById('components-datepicker-demo-time')); ```` diff --git a/components/datepicker/index.md b/components/datepicker/index.md index 247f79bc3a..985bb8af02 100644 --- a/components/datepicker/index.md +++ b/components/datepicker/index.md @@ -25,6 +25,7 @@ | format | 展示的日期格式 | string | "yyyy-MM-dd" | | disabledDate | 不可选择的日期 | function | 无 | | onChange | 时间发生变化的回调,发生在用户选择时间时 | function(Date value) | 无 | +| showTime | 显示时间选择条 | boolean | false | | disabled | 禁用 | bool | false | | calendarStyle | 格外的弹出日历样式,例如 zIndex | object | {} | | size | 输入框大小,`large` 高度为 32px,`small` 为 22px,默认是 28px | string | 无 | diff --git a/components/timepicker/demo/basic.md b/components/timepicker/demo/basic.md index 0548986401..8a75c7de5a 100644 --- a/components/timepicker/demo/basic.md +++ b/components/timepicker/demo/basic.md @@ -10,10 +10,7 @@ import { Timepicker } from 'antd'; function onChange(time) { - console.log(time.toLocaleTimeString()); - console.log('时', time.getHours()); - console.log('分', time.getMinutes()); - console.log('秒', time.getSeconds()); + console.log(time.toTimeString()); } ReactDOM.render(