mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-27 02:18:34 +08:00
29 lines
579 B
TypeScript
29 lines
579 B
TypeScript
|
import React from 'react';
|
||
|
import type { DatePickerProps } from 'antd';
|
||
|
import { DatePicker, Space } from 'antd';
|
||
|
|
||
|
const onChange: DatePickerProps['onChange'] = (date, dateString) => {
|
||
|
console.log(date, dateString);
|
||
|
};
|
||
|
|
||
|
const App: React.FC = () => (
|
||
|
<Space direction="vertical">
|
||
|
<DatePicker
|
||
|
format={{
|
||
|
format: 'YYYY-MM-DD',
|
||
|
type: 'mask',
|
||
|
}}
|
||
|
onChange={onChange}
|
||
|
/>
|
||
|
<DatePicker
|
||
|
format={{
|
||
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||
|
type: 'mask',
|
||
|
}}
|
||
|
onChange={onChange}
|
||
|
/>
|
||
|
</Space>
|
||
|
);
|
||
|
|
||
|
export default App;
|