Commit 8878e4a351fb3bf0b5bd0da3b9681ef3fc573816
1 parent
4a1734b7
Remove validator function (because:)
We have too many use cases and we cannot access props inside validator function, so we cannot do proper checking anyway
Showing
1 changed file
with
1 additions
and
21 deletions
Show diff stats
src/components/date-picker/picker.vue
@@ -154,27 +154,7 @@ | @@ -154,27 +154,7 @@ | ||
154 | default: () => [] | 154 | default: () => [] |
155 | }, | 155 | }, |
156 | value: { | 156 | value: { |
157 | - type: [Date, String, Array], | ||
158 | - validator(val){ | ||
159 | - if (Array.isArray(val)){ | ||
160 | - // check if its empty values | ||
161 | - if (isEmptyArray(val)) return true; | ||
162 | - | ||
163 | - // check if is time format | ||
164 | - if (val[0].match(/^[\d:]+$/) && val[1].match(/^[\d:]+$/)) return true; | ||
165 | - | ||
166 | - // check if its valid value | ||
167 | - const [start, end] = val.map(v => new Date(v)); | ||
168 | - return !isNaN(start.getTime()) && !isNaN(end.getTime()); | ||
169 | - } else { | ||
170 | - if (typeof val === 'string') { | ||
171 | - val = val.trim(); | ||
172 | - if (val.match(/^[\d:]+$/)) return true; // time format | ||
173 | - } | ||
174 | - const date = new Date(val); | ||
175 | - return val === '' || val === null || !isNaN(date.getTime()); | ||
176 | - } | ||
177 | - } | 157 | + type: [Date, String, Array] |
178 | }, | 158 | }, |
179 | options: { | 159 | options: { |
180 | type: Object, | 160 | type: Object, |