import { memo } from 'react' import { DatePicker } from 'antd' import { PickerDateProps } from 'antd/lib/date-picker/generatePicker' import moment, { Moment } from 'moment' import { defaultFormat } from '@utils' export type DatePickerWrapperProps = PickerDateProps & { value?: Moment, onChange?: (date: Moment | null) => any isUTC?: boolean } export const DatePickerWrapper = memo(({ value, onChange, isUTC, ...other }) => ( onChange?.(date)} value={isUTC ? moment.utc(value).local() : moment(value)} {...other} /> )) export default DatePickerWrapper