<template>
<uni-shadow-root class="vant-datetime-picker-index"><van-picker class="van-datetime-picker" active-class="active-class" toolbar-class="toolbar-class" column-class="column-class" :title="title" :columns="columns" :item-height="itemHeight" :show-toolbar="showToolbar" :visible-item-count="visibleItemCount" :confirm-button-text="confirmButtonText" :cancel-button-text="cancelButtonText" @change="onChange" @confirm="onConfirm" @cancel="onCancel"></van-picker></uni-shadow-root>
</template>

<script>
import VanPicker from '../picker/index.vue'
global['__wxVueOptions'] = {components:{'van-picker': VanPicker}}

global['__wxRoute'] = 'vant/datetime-picker/index'
"use strict";

var __assign = undefined && undefined.__assign || function () {
    __assign = Object.assign || function (t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) {
                if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
            }
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var component_1 = require('./../common/component.js');
var utils_1 = require('./../common/utils.js');
var shared_1 = require('./../picker/shared.js');
var currentYear = new Date().getFullYear();
function isValidDate(date) {
    return utils_1.isDef(date) && !isNaN(new Date(date).getTime());
}
function range(num, min, max) {
    return Math.min(Math.max(num, min), max);
}
function padZero(val) {
    return ("00" + val).slice(-2);
}
function times(n, iteratee) {
    var index = -1;
    var result = Array(n < 0 ? 0 : n);
    while (++index < n) {
        result[index] = iteratee(index);
    }
    return result;
}
function getTrueValue(formattedValue) {
    if (!formattedValue) return;
    while (isNaN(parseInt(formattedValue, 10))) {
        formattedValue = formattedValue.slice(1);
    }
    return parseInt(formattedValue, 10);
}
function getMonthEndDay(year, month) {
    return 32 - new Date(year, month - 1, 32).getDate();
}
var defaultFormatter = function defaultFormatter(_, value) {
    return value;
};
component_1.VantComponent({
    classes: ['active-class', 'toolbar-class', 'column-class'],
    props: __assign({}, shared_1.pickerProps, { formatter: {
            type: Function,
            value: defaultFormatter
        }, value: null, type: {
            type: String,
            value: 'datetime'
        }, showToolbar: {
            type: Boolean,
            value: true
        }, minDate: {
            type: Number,
            value: new Date(currentYear - 10, 0, 1).getTime()
        }, maxDate: {
            type: Number,
            value: new Date(currentYear + 10, 11, 31).getTime()
        }, minHour: {
            type: Number,
            value: 0
        }, maxHour: {
            type: Number,
            value: 23
        }, minMinute: {
            type: Number,
            value: 0
        }, maxMinute: {
            type: Number,
            value: 59
        } }),
    data: {
        innerValue: Date.now(),
        columns: []
    },
    watch: {
        value: 'updateValue',
        type: 'updateValue',
        minDate: 'updateValue',
        maxDate: 'updateValue',
        minHour: 'updateValue',
        maxHour: 'updateValue',
        minMinute: 'updateValue',
        maxMinute: 'updateValue'
    },
    methods: {
        updateValue: function updateValue() {
            var _this = this;
            var data = this.data;
            var val = this.correctValue(this.data.value);
            var isEqual = val === data.innerValue;
            if (!isEqual) {
                this.updateColumnValue(val).then(function () {
                    _this.$emit('input', val);
                });
            } else {
                this.updateColumns();
            }
        },
        getPicker: function getPicker() {
            if (this.picker == null) {
                this.picker = this.selectComponent('.van-datetime-picker');
                var picker_1 = this.picker;
                var setColumnValues_1 = picker_1.setColumnValues;
                picker_1.setColumnValues = function () {
                    var args = [];
                    for (var _i = 0; _i < arguments.length; _i++) {
                        args[_i] = arguments[_i];
                    }
                    return setColumnValues_1.apply(picker_1, args.concat([false]));
                };
            }
            return this.picker;
        },
        updateColumns: function updateColumns() {
            var _a = this.data.formatter,
                formatter = _a === void 0 ? defaultFormatter : _a;
            var results = this.getRanges().map(function (_a) {
                var type = _a.type,
                    range = _a.range;
                var values = times(range[1] - range[0] + 1, function (index) {
                    var value = range[0] + index;
                    value = type === 'year' ? "" + value : padZero(value);
                    return formatter(type, value);
                });
                return { values: values };
            });
            return this.set({ columns: results });
        },
        getRanges: function getRanges() {
            var data = this.data;
            if (data.type === 'time') {
                return [{
                    type: 'hour',
                    range: [data.minHour, data.maxHour]
                }, {
                    type: 'minute',
                    range: [data.minMinute, data.maxMinute]
                }];
            }
            var _a = this.getBoundary('max', data.innerValue),
                maxYear = _a.maxYear,
                maxDate = _a.maxDate,
                maxMonth = _a.maxMonth,
                maxHour = _a.maxHour,
                maxMinute = _a.maxMinute;
            var _b = this.getBoundary('min', data.innerValue),
                minYear = _b.minYear,
                minDate = _b.minDate,
                minMonth = _b.minMonth,
                minHour = _b.minHour,
                minMinute = _b.minMinute;
            var result = [{
                type: 'year',
                range: [minYear, maxYear]
            }, {
                type: 'month',
                range: [minMonth, maxMonth]
            }, {
                type: 'day',
                range: [minDate, maxDate]
            }, {
                type: 'hour',
                range: [minHour, maxHour]
            }, {
                type: 'minute',
                range: [minMinute, maxMinute]
            }];
            if (data.type === 'date') result.splice(3, 2);
            if (data.type === 'year-month') result.splice(2, 3);
            return result;
        },
        correctValue: function correctValue(value) {
            var data = this.data;
            // validate value
            var isDateType = data.type !== 'time';
            if (isDateType && !isValidDate(value)) {
                value = data.minDate;
            } else if (!isDateType && !value) {
                var minHour = data.minHour;
                value = padZero(minHour) + ":00";
            }
            // time type
            if (!isDateType) {
                var _a = value.split(':'),
                    hour = _a[0],
                    minute = _a[1];
                hour = padZero(range(hour, data.minHour, data.maxHour));
                minute = padZero(range(minute, data.minMinute, data.maxMinute));
                return hour + ":" + minute;
            }
            // date type
            value = Math.max(value, data.minDate);
            value = Math.min(value, data.maxDate);
            return value;
        },
        getBoundary: function getBoundary(type, innerValue) {
            var _a;
            var value = new Date(innerValue);
            var boundary = new Date(this.data[type + "Date"]);
            var year = boundary.getFullYear();
            var month = 1;
            var date = 1;
            var hour = 0;
            var minute = 0;
            if (type === 'max') {
                month = 12;
                date = getMonthEndDay(value.getFullYear(), value.getMonth() + 1);
                hour = 23;
                minute = 59;
            }
            if (value.getFullYear() === year) {
                month = boundary.getMonth() + 1;
                if (value.getMonth() + 1 === month) {
                    date = boundary.getDate();
                    if (value.getDate() === date) {
                        hour = boundary.getHours();
                        if (value.getHours() === hour) {
                            minute = boundary.getMinutes();
                        }
                    }
                }
            }
            return _a = {}, _a[type + "Year"] = year, _a[type + "Month"] = month, _a[type + "Date"] = date, _a[type + "Hour"] = hour, _a[type + "Minute"] = minute, _a;
        },
        onCancel: function onCancel() {
            this.$emit('cancel');
        },
        onConfirm: function onConfirm() {
            this.$emit('confirm', this.data.innerValue);
        },
        onChange: function onChange() {
            var _this = this;
            var data = this.data;
            var value;
            var picker = this.getPicker();
            if (data.type === 'time') {
                var indexes = picker.getIndexes();
                value = indexes[0] + data.minHour + ":" + (indexes[1] + data.minMinute);
            } else {
                var values = picker.getValues();
                var year = getTrueValue(values[0]);
                var month = getTrueValue(values[1]);
                var maxDate = getMonthEndDay(year, month);
                var date = getTrueValue(values[2]);
                if (data.type === 'year-month') {
                    date = 1;
                }
                date = date > maxDate ? maxDate : date;
                var hour = 0;
                var minute = 0;
                if (data.type === 'datetime') {
                    hour = getTrueValue(values[3]);
                    minute = getTrueValue(values[4]);
                }
                value = new Date(year, month - 1, date, hour, minute);
            }
            value = this.correctValue(value);
            this.updateColumnValue(value).then(function () {
                _this.$emit('input', value);
                _this.$emit('change', picker);
            });
        },
        updateColumnValue: function updateColumnValue(value) {
            var _this = this;
            var values = [];
            var _a = this.data,
                type = _a.type,
                _b = _a.formatter,
                formatter = _b === void 0 ? defaultFormatter : _b;
            var picker = this.getPicker();
            if (type === 'time') {
                var pair = value.split(':');
                values = [formatter('hour', pair[0]), formatter('minute', pair[1])];
            } else {
                var date = new Date(value);
                values = [formatter('year', "" + date.getFullYear()), formatter('month', padZero(date.getMonth() + 1))];
                if (type === 'date') {
                    values.push(formatter('day', padZero(date.getDate())));
                }
                if (type === 'datetime') {
                    values.push(formatter('day', padZero(date.getDate())), formatter('hour', padZero(date.getHours())), formatter('minute', padZero(date.getMinutes())));
                }
            }
            return this.set({ innerValue: value }).then(function () {
                return _this.updateColumns();
            }).then(function () {
                return picker.setValues(values);
            });
        }
    },
    created: function created() {
        var _this = this;
        var innerValue = this.correctValue(this.data.value);
        this.updateColumnValue(innerValue).then(function () {
            _this.$emit('input', innerValue);
        });
    }
});
//# sourceMappingURL=data:application/json;charset=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1ZTsgfTtcbmNvbXBvbmVudF8xLlZhbnRDb21wb25lbnQoe1xuICAgIGNsYXNzZXM6IFsnYWN0aXZlLWNsYXNzJywgJ3Rvb2xiYXItY2xhc3MnLCAnY29sdW1uLWNsYXNzJ10sXG4gICAgcHJvcHM6IF9fYXNzaWduKHt9LCBzaGFyZWRfMS5waWNrZXJQcm9wcywgeyBmb3JtYXR0ZXI6IHtcbiAgICAgICAgICAgIHR5cGU6IEZ1bmN0aW9uLFxuICAgICAgICAgICAgdmFsdWU6IGRlZmF1bHRGb3JtYXR0ZXJcbiAgICAgICAgfSwgdmFsdWU6IG51bGwsIHR5cGU6IHtcbiAgICAgICAgICAgIHR5cGU6IFN0cmluZyxcbiAgICAgICAgICAgIHZhbHVlOiAnZGF0ZXRpbWUnXG4gICAgICAgIH0sIHNob3dUb29sYmFyOiB7XG4gICAgICAgICAgICB0eXBlOiBCb29sZWFuLFxuICAgICAgICAgICAgdmFsdWU6IHRydWVcbiAgICAgICAgfSwgbWluRGF0ZToge1xuICAgICAgICAgICAgdHlwZTogTnVtYmVyLFxuICAgICAgICAgICAgdmFsdWU6IG5ldyBEYXRlKGN1cnJlbnRZZWFyIC0gMTAsIDAsIDEpLmdldFRpbWUoKVxuICAgICAgICB9LCBtYXhEYXRlOiB7XG4gICAgICAgICAgICB0eXBlOiBOdW1iZXIsXG4gICAgICAgICAgICB2YWx1ZTogbmV3IERhdGUoY3VycmVudFllYXIgKyAxMCwgMTEsIDMxKS5nZXRUaW1lKClcbiAgICAgICAgfSwgbWluSG91cjoge1xuICAgICAgICAgICAgdHlwZTogTnVtYmVyLFxuICAgICAgICAgICAgdmFsdWU6IDBcbiAgICAgICAgfSwgbWF4SG91cjoge1xuICAgICAgICAgICAgdHlwZTogTnVtYmVyLFxuICAgICAgICAgICAgdmFsdWU6IDIzXG4gICAgICAgIH0sIG1pbk1pbnV0ZToge1xuICAgICAgICAgICAgdHlwZTogTnVtYmVyLFxuICAgICAgICAgICAgdmFsdWU6IDB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ICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlQ29sdW1ucygpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBnZXRQaWNrZXI6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnBpY2tlciA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5waWNrZXIgPSB0aGlzLnNlbGVjdENvbXBvbmVudCgnLnZhbi1kYXRldGltZS1waWNrZXInKTtcbiAgICAgICAgICAgICAgICB2YXIgcGlja2VyXzEgPSB0aGlzLnBpY2tlcjtcbiAgICAgICAgICAgICAgICB2YXIgc2V0Q29sdW1uVmFsdWVzXzEgPSBwaWNrZXJfMS5zZXRDb2x1bW5WYWx1ZXM7XG4gICAgICAgICAgICAgICAgcGlja2VyXzEuc2V0Q29sdW1uVmFsdWVzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgYXJncyA9IFtdO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBfaSA9IDA7IF9pIDwgYXJndW1lbnRzLmxlbmd0aDsgX2krKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgYXJnc1tfaV0gPSBhcmd1bWVudHNbX2ldO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzZXRDb2x1bW5WYWx1ZXNfMS5hcHBseShwaWNrZXJfMSwgYXJncy5jb25jYXQoW2ZhbHNlXSkpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5waWNrZXI7XG4gICAgICAgIH0sXG4gICAgICAgIHVwZGF0ZUNvbHVtbnM6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBfYSA9IHRoaXMuZGF0YS5mb3JtYXR0ZXIsIGZvcm1hdHRlciA9IF9hID09PSB2b2lkIDAgPyBkZWZhdWx0Rm9ybWF0dGVyIDogX2E7XG4gICAgICAgICAgICB2YXIgcmVzdWx0cyA9IHRoaXMuZ2V0UmFuZ2VzKCkubWFwKGZ1bmN0aW9uIChfYSkge1xuICAgICAgICAgICAgICAgIHZhciB0eXBlID0gX2EudHlwZSwgcmFuZ2UgPSBfYS5yYW5nZTtcbiAgICAgICAgICAgICAgICB2YXIgdmFsdWVzID0gdGltZXMocmFuZ2VbMV0gLSByYW5nZVswXSArIDEsIGZ1bmN0aW9uIChpbmRleCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdmFsdWUgPSByYW5nZVswXSArIGluZGV4O1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHR5cGUgPT09ICd5ZWFyJyA/IFwiXCIgKyB2YWx1ZSA6IHBhZFplcm8odmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZm9ybWF0dGVyKHR5cGUsIHZhbHVlKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICByZXR1cm4geyB2YWx1ZXM6IHZhbHVlcyB9O1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5zZXQoeyBjb2x1bW5zOiByZXN1bHRzIH0pO1xuICAgICAgICB9LFxuICAgICAgICBnZXRSYW5nZXM6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBkYXRhID0gdGhpcy5kYXRhO1xuICAgICAgICAgICAgaWYgKGRhdGEudHlwZSA9PT0gJ3RpbWUnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ2hvdXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgcmFuZ2U6IFtkYXRhLm1pbkhvdXIsIGRhdGEubWF4SG91cl1cbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ21pbnV0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICByYW5nZTogW2RhdGEubWluTWludXRlLCBkYXRhLm1heE1pbnV0ZV1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgX2EgPSB0aGlzLmdldEJvdW5kYXJ5KCdtYXgnLCBkYXRhLmlubmVyVmFsdWUpLCBtYXhZZWFyID0gX2EubWF4WWVhciwgbWF4RGF0ZSA9IF9hLm1heERhdGUsIG1heE1vbnRoID0gX2EubWF4TW9udGgsIG1heEhvdXIgPSBfYS5tYXhIb3VyLCBtYXhNaW51dGUgPSBfYS5tYXhNaW51dGU7XG4gICAgICAgICAgICB2YXIgX2IgPSB0aGlzLmdldEJvdW5kYXJ5KCdtaW4nLCBkYXRhLmlubmVyVmFsdWUpLCBtaW5ZZWFyID0gX2IubWluWWVhciwgbWluRGF0ZSA9IF9iLm1pbkRhdGUsIG1pbk1vbnRoID0gX2IubWluTW9udGgsIG1pbkhvdXIgPSBfYi5taW5Ib3VyLCBtaW5NaW51dGUgPSBfYi5taW5NaW51dGU7XG4gICAgICAgICAgICB2YXIgcmVzdWx0ID0gW1xuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3llYXInLFxuICAgICAgICAgICAgICAgICAgICByYW5nZTogW21pblllYXIsIG1heFllYXJdXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIHR5cGU6ICdtb250aCcsXG4gICAgICAgICAgICAgICAgICAgIHJhbmdlOiBbbWluTW9udGgsIG1heE1vbnRoXVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiAnZGF5JyxcbiAgICAgICAgICAgICAgICAgICAgcmFuZ2U6IFttaW5EYXRlLCBtYXhEYXRlXVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiAnaG91cicsXG4gICAgICAgICAgICAgICAgICAgIHJhbmdlOiBbbWluSG91ciwgbWF4SG91cl1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogJ21pbnV0ZScsXG4gICAgICAgICAgICAgICAgICAgIHJhbmdlOiBbbWluTWludXRlLCBtYXhNaW51dGVdXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIGlmIChkYXRhLnR5cGUgPT09ICdkYXRlJylcbiAgICAgICAgICAgICAgICByZXN1bHQuc3BsaWNlKDMsIDIpO1xuICAgICAgICAgICAgaWYgKGRhdGEudHlwZSA9PT0gJ3llYXItbW9udGgnKVxuICAgICAgICAgICAgICAgIHJlc3VsdC5zcGxpY2UoMiwgMyk7XG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICB9LFxuICAgICAgICBjb3JyZWN0VmFsdWU6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgdmFyIGRhdGEgPSB0aGlzLmRhdGE7XG4gICAgICAgICAgICAvLyB2YWxpZGF0ZSB2YWx1ZVxuICAgICAgICAgICAgdmFyIGlzRGF0ZVR5cGUgPSBkYXRhLnR5cGUgIT09ICd0aW1lJztcbiAgICAgICAgICAgIGlmIChpc0RhdGVUeXBlICYmICFpc1ZhbGlkRGF0ZSh2YWx1ZSkpIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGRhdGEubWluRGF0ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKCFpc0RhdGVUeXBlICYmICF2YWx1ZSkge1xuICAgICAgICAgICAgICAgIHZhciBtaW5Ib3VyID0gZGF0YS5taW5Ib3VyO1xuICAgICAgICAgICAgICAgIHZhbHVlID0gcGFkWmVybyhtaW5Ib3VyKSArIFwiOjAwXCI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyB0aW1lIHR5cGVcbiAgICAgICAgICAgIGlmICghaXNEYXRlVHlwZSkge1xuICAgICAgICAgICAgICAgIHZhciBfYSA9IHZhbHVlLnNwbGl0KCc6JyksIGhvdXIgPSBfYVswXSwgbWludXRlID0gX2FbMV07XG4gICAgICAgICAgICAgICAgaG91ciA9IHBhZFplcm8ocmFuZ2UoaG91ciwgZGF0YS5taW5Ib3VyLCBkYXRhLm1heEhvdXIpKTtcbiAgICAgICAgICAgICAgICBtaW51dGUgPSBwYWRaZXJvKHJhbmdlKG1pbnV0ZSwgZGF0YS5taW5NaW51dGUsIGRhdGEubWF4TWludXRlKSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgKyBcIjpcIiArIG1pbnV0ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGRhdGUgdHlwZVxuICAgICAgICAgICAgdmFsdWUgPSBNYXRoLm1heCh2YWx1ZSwgZGF0YS5taW5EYXRlKTtcbiAgICAgICAgICAgIHZhbHVlID0gTWF0aC5taW4odmFsdWUsIGRhdGEubWF4RGF0ZSk7XG4gICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgIH0sXG4gICAgICAgIGdldEJvdW5kYXJ5OiBmdW5jdGlvbiAodHlwZSwgaW5uZXJWYWx1ZSkge1xuICAgICAgICAgICAgdmFyIF9hO1xuICAgICAgICAgICAgdmFyIHZhbHVlID0gbmV3IERhdGUoaW5uZXJWYWx1ZSk7XG4gICAgICAgICAgICB2YXIgYm91bmRhcnkgPSBuZXcgRGF0ZSh0aGlzLmRhdGFbdHlwZSArIFwiRGF0ZVwiXSk7XG4gICAgICAgICAgICB2YXIgeWVhciA9IGJvdW5kYXJ5LmdldEZ1bGxZZWFyKCk7XG4gICAgICAgICAgICB2YXIgbW9udGggPSAxO1xuICAgICAgICAgICAgdmFyIGRhdGUgPSAxO1xuICAgICAgICAgICAgdmFyIGhvdXIgPSAwO1xuICAgICAgICAgICAgdmFyIG1pbnV0ZSA9IDA7XG4gICAgICAgICAgICBpZiAodHlwZSA9PT0gJ21heCcpIHtcbiAgICAgICAgICAgICAgICBtb250aCA9IDEyO1xuICAgICAgICAgICAgICAgIGRhdGUgPSBnZXRNb250aEVuZERheSh2YWx1ZS5nZXRGdWxsWWVhcigpLCB2YWx1ZS5nZXRNb250aCgpICsgMSk7XG4gICAgICAgICAgICAgICAgaG91ciA9IDIzO1xuICAgICAgICAgICAgICAgIG1pbnV0ZSA9IDU5O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHZhbHVlLmdldEZ1bGxZZWFyKCkgPT09IHllYXIpIHtcbiAgICAgICAgICAgICAgICBtb250aCA9IGJvdW5kYXJ5LmdldE1vbnRoKCkgKyAxO1xuICAgICAgICAgICAgICAgIGlmICh2YWx1ZS5nZXRNb250aCgpICsgMSA9PT0gbW9udGgpIHtcbiAgICAgICAgICAgICAgICAgICAgZGF0ZSA9IGJvdW5kYXJ5LmdldERhdGUoKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlLmdldERhdGUoKSA9PT0gZGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaG91ciA9IGJvdW5kYXJ5LmdldEhvdXJzKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUuZ2V0SG91cnMoKSA9PT0gaG91cikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pbnV0ZSA9IGJvdW5kYXJ5LmdldE1pbnV0ZXMoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBfYSA9IHt9LFxuICAgICAgICAgICAgICAgIF9hW3R5cGUgKyBcIlllYXJcIl0gPSB5ZWFyLFxuICAgICAgICAgICAgICAgIF9hW3R5cGUgKyBcIk1vbnRoXCJdID0gbW9udGgsXG4gICAgICAgICAgICAgICAgX2FbdHlwZSArIFwiRGF0ZVwiXSA9IGRhdGUsXG4gICAgICAgICAgICAgICAgX2FbdHlwZSArIFwiSG91clwiXSA9IGhvdXIsXG4gICAgICAgICAgICAgICAgX2FbdHlwZSArIFwiTWludXRlXCJdID0gbWludXRlLFxuICAgICAgICAgICAgICAgIF9hO1xuICAgICAgICB9LFxuICAgICAgICBvbkNhbmNlbDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdGhpcy4kZW1pdCgnY2FuY2VsJyk7XG4gICAgICAgIH0sXG4gICAgICAgIG9uQ29uZmlybTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdGhpcy4kZW1pdCgnY29uZmlybScsIHRoaXMuZGF0YS5pbm5lclZhbHVlKTtcbiAgICAgICAgfSxcbiAgICAgICAgb25DaGFuZ2U6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YTtcbiAgICAgICAgICAgIHZhciB2YWx1ZTtcbiAgICAgICAgICAgIHZhciBwaWNrZXIgPSB0aGlzLmdldFBpY2tlcigpO1xuICAgICAgICAgICAgaWYgKGRhdGEudHlwZSA9PT0gJ3RpbWUnKSB7XG4gICAgICAgICAgICAgICAgdmFyIGluZGV4ZXMgPSBwaWNrZXIuZ2V0SW5kZXhlcygpO1xuICAgICAgICAgICAgICAgIHZhbHVlID0gaW5kZXhlc1swXSArIGRhdGEubWluSG91ciArIFwiOlwiICsgKGluZGV4ZXNbMV0gKyBkYXRhLm1pbk1pbnV0ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YXIgdmFsdWVzID0gcGlja2VyLmdldFZhbHVlcygpO1xuICAgICAgICAgICAgICAgIHZhciB5ZWFyID0gZ2V0VHJ1ZVZhbHVlKHZhbHVlc1swXSk7XG4gICAgICAgICAgICAgICAgdmFyIG1vbnRoID0gZ2V0VHJ1ZVZhbHVlKHZhbHVlc1sxXSk7XG4gICAgICAgICAgICAgICAgdmFyIG1heERhdGUgPSBnZXRNb250aEVuZERheSh5ZWFyLCBtb250aCk7XG4gICAgICAgICAgICAgICAgdmFyIGRhdGUgPSBnZXRUcnVlVmFsdWUodmFsdWVzWzJdKTtcbiAgICAgICAgICAgICAgICBpZiAoZGF0YS50eXBlID09PSAneWVhci1tb250aCcpIHtcbiAgICAgICAgICAgICAgICAgICAgZGF0ZSA9IDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRhdGUgPSBkYXRlID4gbWF4RGF0ZSA/IG1heERhdGUgOiBkYXRlO1xuICAgICAgICAgICAgICAgIHZhciBob3VyID0gMDtcbiAgICAgICAgICAgICAgICB2YXIgbWludXRlID0gMDtcbiAgICAgICAgICAgICAgICBpZiAoZGF0YS50eXBlID09PSAnZGF0ZXRpbWUnKSB7XG4gICAgICAgICAgICAgICAgICAgIGhvdXIgPSBnZXRUcnVlVmFsdWUodmFsdWVzWzNdKTtcbiAgICAgICAgICAgICAgICAgICAgbWludXRlID0gZ2V0VHJ1ZVZhbHVlKHZhbHVlc1s0XSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhbHVlID0gbmV3IERhdGUoeWVhciwgbW9udGggLSAxLCBkYXRlLCBob3VyLCBtaW51dGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFsdWUgPSB0aGlzLmNvcnJlY3RWYWx1ZSh2YWx1ZSk7XG4gICAgICAgICAgICB0aGlzLnVwZGF0ZUNvbHVtblZhbHVlKHZhbHVlKS50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBfdGhpcy4kZW1pdCgnaW5wdXQnLCB2YWx1ZSk7XG4gICAgICAgICAgICAgICAgX3RoaXMuJGVtaXQoJ2NoYW5nZScsIHBpY2tlcik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgdXBkYXRlQ29sdW1uVmFsdWU6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgICAgIHZhciB2YWx1ZXMgPSBbXTtcbiAgICAgICAgICAgIHZhciBfYSA9IHRoaXMuZGF0YSwgdHlwZSA9IF9hLnR5cGUsIF9iID0gX2EuZm9ybWF0dGVyLCBmb3JtYXR0ZXIgPSBfYiA9PT0gdm9pZCAwID8gZGVmYXVsdEZvcm1hdHRlciA6IF9iO1xuICAgICAgICAgICAgdmFyIHBpY2tlciA9IHRoaXMuZ2V0UGlja2VyKCk7XG4gICAgICAgICAgICBpZiAodHlwZSA9PT0gJ3RpbWUnKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhaXIgPSB2YWx1ZS5zcGxpdCgnOicpO1xuICAgICAgICAgICAgICAgIHZhbHVlcyA9IFtcbiAgICAgICAgICAgICAgICAgICAgZm9ybWF0dGVyKCdob3VyJywgcGFpclswXSksXG4gICAgICAgICAgICAgICAgICAgIGZvcm1hdHRlcignbWludXRlJywgcGFpclsxXSlcbiAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIGRhdGUgPSBuZXcgRGF0ZSh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgdmFsdWVzID0gW1xuICAgICAgICAgICAgICAgICAgICBmb3JtYXR0ZXIoJ3llYXInLCBcIlwiICsgZGF0ZS5nZXRGdWxsWWVhcigpKSxcbiAgICAgICAgICAgICAgICAgICAgZm9ybWF0dGVyKCdtb250aCcsIHBhZFplcm8oZGF0ZS5nZXRNb250aCgpICsgMSkpXG4gICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gJ2RhdGUnKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlcy5wdXNoKGZvcm1hdHRlcignZGF5JywgcGFkWmVybyhkYXRlLmdldERhdGUoKSkpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09ICdkYXRldGltZScpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWVzLnB1c2goZm9ybWF0dGVyKCdkYXknLCBwYWRaZXJvKGRhdGUuZ2V0RGF0ZSgpKSksIGZvcm1hdHRlcignaG91cicsIHBhZFplcm8oZGF0ZS5nZXRIb3VycygpKSksIGZvcm1hdHRlcignbWludXRlJywgcGFkWmVybyhkYXRlLmdldE1pbnV0ZXMoKSkpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5zZXQoeyBpbm5lclZhbHVlOiB2YWx1ZSB9KVxuICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uICgpIHsgcmV0dXJuIF90aGlzLnVwZGF0ZUNvbHVtbnMoKTsgfSlcbiAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAoKSB7IHJldHVybiBwaWNrZXIuc2V0VmFsdWVzKHZhbHVlcyk7IH0pO1xuICAgICAgICB9XG4gICAgfSxcbiAgICBjcmVhdGVkOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHZhciBpbm5lclZhbHVlID0gdGhpcy5jb3JyZWN0VmFsdWUodGhpcy5kYXRhLnZhbHVlKTtcbiAgICAgICAgdGhpcy51cGRhdGVDb2x1bW5WYWx1ZShpbm5lclZhbHVlKS50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIF90aGlzLiRlbWl0KCdpbnB1dCcsIGlubmVyVmFsdWUpO1xuICAgICAgICB9KTtcbiAgICB9XG59KTtcbiJdLCJmaWxlIjoiaW5kZXguanMifQ==
export default global['__wxComponents']['vant/datetime-picker/index']
</script>
<style platform="mp-weixin">
@import '../common/index.css';
</style>