import {DatePicker} from 'antd';  // 加载 JS
import locale from 'antd/lib/date-picker/locale/zh_CN';
import moment from 'moment';
import 'moment/locale/zh-cn';
import React from "react";
//import 'antd/lib/date-picker/style/css';        // 加载 CSS
const {RangePicker} = DatePicker;
// 由于 antd 组件的默认文案是英文，所以需要修改为中文
moment.locale('zh-cn');

export default class Picker extends React.Component {
  render(){
    return(
      <RangePicker
        className="ks-range-picker"
        locale={locale}
        allowClear={false}
        disabledDate={(current) => (current && current > moment().endOf('day'))}
        getCalendarContainer={() => (this.props.dataInput)}
        onChange={this.props.timeOnChange}
      />
    )
  }
}