import React, { useContext, useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { Input } from 'antd';
import DatePickerCustom, { TimePickerCustom, RangePickerCustom } from '../index';

const Demo = (props) => {
  const [startTime, setStartTime] = useState('');
  const [endTime, setEndTime] = useState('');
  const onChange = (date, dateString) => {
    console.log(date);
    setStartTime(date.startTime);
    setEndTime(date.endTime);
  };
  return (
    <>
      <DatePickerCustom
        onChange={onChange}
        picker="date"
        style={{ marginRight: '10px', marginBottom: '10px' }}
      />
      <DatePickerCustom
        onChange={onChange}
        picker="week"
        style={{ marginRight: '10px', marginBottom: '10px' }}
      />
      <DatePickerCustom
        onChange={onChange}
        picker="month"
        style={{ marginRight: '10px', marginBottom: '10px' }}
      />
      <DatePickerCustom
        onChange={onChange}
        picker="quarter"
        style={{ marginRight: '10px', marginBottom: '10px' }}
      />
      <DatePickerCustom
        onChange={onChange}
        picker="year"
        style={{ marginRight: '10px', marginBottom: '10px' }}
      />
      <div style={{ display: 'flex' }}>
        <Input
          value={startTime}
          placeholder="起始时间"
          style={{ marginRight: '10px', width: '250px' }}
        />
        <Input
          value={endTime}
          placeholder="结束时间"
          style={{ marginRight: '10px', width: '250px' }}
        />
      </div>
    </>
  );
};

export default Demo;