diff --git a/src/components/date-picker/picker.vue b/src/components/date-picker/picker.vue index 0aeb1c5..ea56414 100644 --- a/src/components/date-picker/picker.vue +++ b/src/components/date-picker/picker.vue @@ -154,27 +154,7 @@ default: () => [] }, value: { - type: [Date, String, Array], - validator(val){ - if (Array.isArray(val)){ - // check if its empty values - if (isEmptyArray(val)) return true; - - // check if is time format - if (val[0].match(/^[\d:]+$/) && val[1].match(/^[\d:]+$/)) return true; - - // check if its valid value - const [start, end] = val.map(v => new Date(v)); - return !isNaN(start.getTime()) && !isNaN(end.getTime()); - } else { - if (typeof val === 'string') { - val = val.trim(); - if (val.match(/^[\d:]+$/)) return true; // time format - } - const date = new Date(val); - return val === '' || val === null || !isNaN(date.getTime()); - } - } + type: [Date, String, Array] }, options: { type: Object, -- libgit2 0.21.4