import DatePicker from '..';
import React from 'react';
import ReactDOM from 'react-dom';
import moment from 'moment';
const { RangePicker, MonthPicker, YearPicker } = DatePicker;
const currentDate = moment();
// Disable all dates before today
const disabledDate = function (date, view) {
    switch (view) {
        case 'date':
            return date.valueOf() <= currentDate.valueOf();
        case 'year':
            return date.year() < currentDate.year();
        case 'month':
            return (date.year() * 100 + date.month() <
                currentDate.year() * 100 + currentDate.month());
        default:
            return false;
    }
};
ReactDOM.render(React.createElement("div", null,
    React.createElement(DatePicker, { disabledDate: disabledDate, onChange: val => console.log(val) }),
    React.createElement("br", null),
    React.createElement("br", null),
    React.createElement(MonthPicker, { disabledDate: disabledDate, onChange: val => console.log(val) }),
    React.createElement("br", null),
    React.createElement("br", null),
    React.createElement(YearPicker, { disabledDate: disabledDate, onChange: val => console.log(val) }),
    React.createElement("br", null),
    React.createElement("br", null),
    React.createElement(RangePicker, { disabledDate: disabledDate, onChange: val => console.log(val) }),
    React.createElement("br", null),
    React.createElement("br", null),
    React.createElement(RangePicker, { type: "month", disabledDate: disabledDate, onChange: val => console.log(val) }),
    React.createElement("br", null),
    React.createElement("br", null),
    React.createElement(RangePicker, { type: "year", disabledDate: disabledDate, onChange: val => console.log(val) })), document.getElementById('date-picker-demo-5'));
