"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = (0, tslib_1.__importStar)(require("react"));
var weui_1 = (0, tslib_1.__importDefault)(require("../../utils/weui"));
var classnames_1 = (0, tslib_1.__importDefault)(require("../../utils/classnames"));
function DatePicker(props) {
    var _a;
    var start = props.start, end = props.end, defaultValue = props.defaultValue, title = props.title, children = props.children, className = props.className;
    var click = function () {
        var fixedDefaultValue = undefined;
        if (defaultValue) {
            var defaultDate = new Date(defaultValue);
            fixedDefaultValue = [
                defaultDate.getFullYear(),
                defaultDate.getMonth() + 1,
                defaultDate.getDate(),
            ];
        }
        weui_1.default.datePicker((0, tslib_1.__assign)({
            start: start,
            end: end,
            title: title,
        }, (fixedDefaultValue ? { defaultValue: fixedDefaultValue } : {})));
    };
    var cls = (0, classnames_1.default)((_a = {
            'weda-ui': true,
            'weda-date-picker': true
        },
        _a[className] = className,
        _a));
    return (React.createElement("div", { className: cls, onClick: click }, children));
}
exports.default = DatePicker;
//# sourceMappingURL=datePicker.js.map