mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
6776bb8916
* docs: update demo * chore: add script * test: fix demo test * docs: convert demos * chore: move script * test: remove react-dom import * chore: update deps * docs: update riddle js * test: fix image test * docs: fix riddle demo
31 lines
586 B
Markdown
31 lines
586 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);
|
|
}
|
|
|
|
export default () => (
|
|
<>
|
|
<TimePicker use12Hours onChange={onChange} />
|
|
<TimePicker use12Hours format="h:mm:ss A" onChange={onChange} style={{ width: 140 }} />
|
|
<TimePicker use12Hours format="h:mm a" onChange={onChange} />
|
|
</>
|
|
);
|
|
```
|