import React from 'react'; import { DatePicker, Space } from 'antd'; import type { DatePickerProps, GetProps } from 'antd'; type RangePickerProps = GetProps; const { RangePicker } = DatePicker; const onOk = (value: DatePickerProps['value'] | RangePickerProps['value']) => { console.log('onOk: ', value); }; const App: React.FC = () => ( { console.log('Selected Time: ', value); console.log('Formatted Selected Time: ', dateString); }} onOk={onOk} /> { console.log('Selected Time: ', value); console.log('Formatted Selected Time: ', dateString); }} onOk={onOk} /> ); export default App;