Merge pull request #3177 from SergioCrisostomo/fix-3161

Fix type passed when no value is given for timerange
This commit is contained in:
Aresn 2018-03-20 09:49:22 +08:00 committed by GitHub
commit f4f34695fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -334,7 +334,7 @@
if (typeof val === 'string') {
val = parser(val, format);
} else if (type === 'timerange') {
val = parser(val, format);
val = parser(val, format).map(v => v || '');
} else {
val = val.map(date => new Date(date)); // try to parse
val = val.map(date => isNaN(date.getTime()) ? null : date); // check if parse passed