mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
upgrade rc-time-picker to 2.2.0, support TimePicker[format="HH"] (#3793)
This commit is contained in:
parent
4da0ae4f42
commit
524a421d72
@ -13,7 +13,6 @@ title:
|
||||
|
||||
Render addon contents to timepicker panel's bottom.
|
||||
|
||||
|
||||
````jsx
|
||||
import { TimePicker, Button } from 'antd';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
order: 0
|
||||
title:
|
||||
title:
|
||||
zh-CN: 基本
|
||||
en-US: Basic
|
||||
---
|
||||
@ -9,9 +9,9 @@ title:
|
||||
|
||||
最简单的用法。
|
||||
|
||||
## en-US
|
||||
## en-US
|
||||
|
||||
The most basic usage.
|
||||
The most basic usage.
|
||||
|
||||
````jsx
|
||||
import { TimePicker } from 'antd';
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
order: 5
|
||||
title:
|
||||
title:
|
||||
zh-CN: 禁止选项
|
||||
en-US: Specify the time that cannot be selected
|
||||
---
|
||||
@ -8,7 +8,7 @@ title:
|
||||
|
||||
限制选择 `20:30` 到 `23:30` 这个时间段。
|
||||
|
||||
## en-US
|
||||
## en-US
|
||||
|
||||
You can't select the time from `20:30` to `23:30`.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
order: 4
|
||||
title:
|
||||
title:
|
||||
zh-CN: 禁用
|
||||
en-US: disabled
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
order: 6
|
||||
title:
|
||||
title:
|
||||
zh-CN: 只显示部分选项
|
||||
en-US: Show part of options.
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
order: 2
|
||||
title:
|
||||
order: 2
|
||||
title:
|
||||
zh-CN: 三种大小
|
||||
en-US: Three sizes
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
order: 1
|
||||
title:
|
||||
title:
|
||||
zh-CN: 受控组件
|
||||
en-US: Under control
|
||||
---
|
||||
@ -11,7 +11,7 @@ value 和 onChange 需要配合使用。
|
||||
|
||||
## en-US
|
||||
|
||||
`Value` and `onChange` should be used together,
|
||||
`Value` and `onChange` should be used together,
|
||||
|
||||
````jsx
|
||||
import { TimePicker } from 'antd';
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
order: 3
|
||||
title:
|
||||
title:
|
||||
zh-CN: 不展示秒
|
||||
en-US: Hide the seconds options
|
||||
---
|
||||
@ -18,6 +18,7 @@ import { TimePicker } from 'antd';
|
||||
import moment from 'moment';
|
||||
|
||||
const format = 'HH:mm';
|
||||
|
||||
ReactDOM.render(
|
||||
<TimePicker defaultValue={moment('12:08', format)} format={format} />
|
||||
, mountNode);
|
||||
|
@ -107,6 +107,7 @@ export default class TimePicker extends React.Component<TimePickerProps, any> {
|
||||
value={this.state.value}
|
||||
placeholder={props.placeholder || this.getLocale().placeholder}
|
||||
showHour={props.format.indexOf('HH') > -1}
|
||||
showMinute={props.format.indexOf('mm') > -1}
|
||||
showSecond={props.format.indexOf('ss') > -1}
|
||||
onChange={this.handleChange}
|
||||
addon={(panel) => (
|
||||
|
@ -65,7 +65,7 @@
|
||||
"rc-switch": "~1.4.2",
|
||||
"rc-table": "~5.0.0",
|
||||
"rc-tabs": "~7.0.5",
|
||||
"rc-time-picker": "~2.1.0",
|
||||
"rc-time-picker": "~2.2.0",
|
||||
"rc-tooltip": "~3.4.2",
|
||||
"rc-tree": "~1.4.0",
|
||||
"rc-tree-select": "~1.8.0",
|
||||
|
Loading…
Reference in New Issue
Block a user