import React from 'react';
import { DatePicker } from 'antd';
import styles from './styles.less';
import { antiAssign } from '../../../../utils/utils';

const { RangePicker } = DatePicker;
export const ApolloDateRange = (props: any) => {
    const { onChange } = props;
    const selfProps = antiAssign(props, ['onChange', 'columnConfig']);
    const changeValue = (dates, dateStrings) => {
        if (typeof onChange === 'function') {
            onChange(dates, dateStrings);
        }
    };
    return (
        <RangePicker
            className={styles.date}
            dropdownClassName={styles.dropdownClassName}
            // popupStyle={{ width: '350px' }}
            {...selfProps}
            onChange={changeValue}
        />
    );
};
