"use strict";

var _ = _interopRequireDefault(require(".."));

var _react = _interopRequireDefault(require("react"));

var _reactDom = _interopRequireDefault(require("react-dom"));

var _moment = _interopRequireDefault(require("moment"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var RangePicker = _["default"].RangePicker,
    MonthPicker = _["default"].MonthPicker,
    YearPicker = _["default"].YearPicker;
var currentDate = (0, _moment["default"])(); // Disable all dates before today

var disabledDate = function disabledDate(date, mode) {
  switch (mode) {
    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["default"].render( /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_["default"], {
  disabledDate: disabledDate,
  onChange: function onChange(val) {
    return console.log(val);
  }
}), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement(MonthPicker, {
  disabledDate: disabledDate,
  onChange: function onChange(val) {
    return console.log(val);
  }
}), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement(YearPicker, {
  disabledDate: disabledDate,
  onChange: function onChange(val) {
    return console.log(val);
  }
}), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement(RangePicker, {
  disabledDate: disabledDate,
  onChange: function onChange(val) {
    return console.log(val);
  }
}), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("br", null)), document.getElementById('date-picker2-demo-4'));