"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

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

var _rangePickerPop = _interopRequireDefault(require("../range-picker-pop"));

var _formatTime = require("../../utils/format-time");

var _getLocale = require("../../utils/getLocale");

var _searchDropdown = _interopRequireDefault(require("./search-dropdown"));

require("./index.css");

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

var Timer = function Timer(_ref) {
  var setParma = _ref.setParma,
      parmas = _ref.parmas,
      setType = _ref.setType;
  var _parmas$date = parmas.date,
      createDate = _parmas$date.createDate,
      endDate = _parmas$date.endDate;

  var onStartDateConfirmHandler = function onStartDateConfirmHandler(data) {
    setType("");
    var date = {
      createDate: data.startDate,
      endDate: data.endDate
    };
    setParma("date", date);
  };

  return /*#__PURE__*/_react["default"].createElement(_rangePickerPop["default"], {
    format: "YYYY/MM/DD",
    controlled: true,
    onConfirm: onStartDateConfirmHandler,
    defaultRange: {
      startDate: createDate || (0, _formatTime.showMonthFirstDay)(),
      endDate: endDate || (0, _formatTime.showMonthLastDay)()
    }
  }, /*#__PURE__*/_react["default"].createElement(_searchDropdown["default"], {
    noRightLine: true
  }, (0, _getLocale.getLocale)("Feed_Set_Pop_Butt_Time")));
};

var _default = Timer;
exports["default"] = _default;