import React, { useRef } from 'react'; import { DatePicker } from 'antd'; import { onBlurFn } from '../onBlurFn'; import { antiAssign } from '../../../../utils/utils'; import styles from './styles.less'; export const ApolloDate = (props: any) => { const { origin, onChange } = props; const selfProps = antiAssign(props, ['onChange', 'columnConfig']); const isOpen = useRef(); const changeValue = (date, dateString) => { if (typeof onChange === 'function') { if (typeof onBlurFn === 'function' && !isOpen.current) { onBlurFn({ ...props, value: date }); } onChange(date, dateString); } }; const inputOnBlurFn = (e: boolean) => { isOpen.current = e; }; return (origin === 'editForm' ? : ); };