resume date time demo

This commit is contained in:
afc163 2015-11-19 16:28:28 +08:00
parent 2e54c5b30d
commit 8d85684b12
3 changed files with 7 additions and 21 deletions

View File

@ -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(<div>
<Datepicker onChange={onDateChange} />
<Timepicker onChange={onTimeChange} />
</div>, document.getElementById('components-datepicker-demo-time'));
ReactDOM.render(
<Datepicker showTime={true} format="yyyy-MM-dd HH:mm:ss" defaultValue="2015-11-11 11:11:11"/>
, document.getElementById('components-datepicker-demo-time'));
````

View File

@ -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 | 无 |

View File

@ -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(