mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-21 21:28:09 +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;
|