mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-16 01:41:02 +08:00
32 lines
577 B
Markdown
32 lines
577 B
Markdown
---
|
|
order: 7
|
|
title:
|
|
zh-CN: 12 小时制
|
|
en-US: 12 hours
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
12 小时制的时间选择器,默认的 format 为 `h:mm:ss a`。
|
|
|
|
## en-US
|
|
|
|
TimePicker of 12 hours format, with default format `h:mm:ss a`.
|
|
|
|
```jsx
|
|
import { TimePicker } from 'antd';
|
|
|
|
function onChange(time, timeString) {
|
|
console.log(time, timeString);
|
|
}
|
|
|
|
ReactDOM.render(
|
|
<div>
|
|
<TimePicker use12Hours onChange={onChange} />
|
|
<TimePicker use12Hours format="h:mm:ss A" onChange={onChange} />
|
|
<TimePicker use12Hours format="h:mm a" onChange={onChange} />
|
|
</div>,
|
|
mountNode,
|
|
);
|
|
```
|