Commit f4f34695fdcc2c4f0c06357f096fa53681ffb4ae
Committed by
GitHub

Merge pull request #3177 from SergioCrisostomo/fix-3161
Fix type passed when no value is given for timerange
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
src/components/date-picker/picker.vue
@@ -334,7 +334,7 @@ | @@ -334,7 +334,7 @@ | ||
334 | if (typeof val === 'string') { | 334 | if (typeof val === 'string') { |
335 | val = parser(val, format); | 335 | val = parser(val, format); |
336 | } else if (type === 'timerange') { | 336 | } else if (type === 'timerange') { |
337 | - val = parser(val, format); | 337 | + val = parser(val, format).map(v => v || ''); |
338 | } else { | 338 | } else { |
339 | val = val.map(date => new Date(date)); // try to parse | 339 | val = val.map(date => new Date(date)); // try to parse |
340 | val = val.map(date => isNaN(date.getTime()) ? null : date); // check if parse passed | 340 | val = val.map(date => isNaN(date.getTime()) ? null : date); // check if parse passed |