/** @format */
import * as React from 'react';
import moment, {Moment} from 'moment';
import {DatePickerProps} from 'antd/es/date-picker/interface';
import locale from 'antd/es/date-picker/locale/zh_CN';
import 'moment/locale/zh-cn';
moment.locale('zh-cn');
import {DatePicker} from 'antd';
const {RangePicker} = DatePicker;
const startTime = moment('00:00:00', 'HH:mm:ss');
const endTime = moment('23:59:59', 'HH:mm:ss');
const disabledDate = (current: Moment | undefined) => {
    return !!current && current > moment().endOf('day');
};
export default React.forwardRef((props: DatePickerProps, ref) => {
    return (
        <RangePicker
            allowClear={false}
            disabledDate={disabledDate}
            locale={locale}
            ranges={{
                今天: [startTime, endTime],
            }}
            {...props}
        />
    );
});
