import { __assign } from "tslib";
import * as React from 'react';
import weui from '../../utils/weui';
import classNames from '../../utils/classnames';
export default 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.datePicker(__assign({
            start: start,
            end: end,
            title: title,
        }, (fixedDefaultValue ? { defaultValue: fixedDefaultValue } : {})));
    };
    var cls = classNames((_a = {
            'weda-ui': true,
            'weda-date-picker': true
        },
        _a[className] = className,
        _a));
    return (React.createElement("div", { className: cls, onClick: click }, children));
}
//# sourceMappingURL=datePicker.js.map