Fix daterange manual date insertion
This commit is contained in:
parent
b5ca23f5ef
commit
283b90aa38
1 changed files with 6 additions and 2 deletions
|
@ -309,10 +309,14 @@
|
||||||
} else if (isRange) {
|
} else if (isRange) {
|
||||||
if (!val){
|
if (!val){
|
||||||
val = [null, null];
|
val = [null, null];
|
||||||
|
} else {
|
||||||
|
if (typeof val === 'string') {
|
||||||
|
val = parser(val, format);
|
||||||
} else {
|
} else {
|
||||||
val = val.map(date => new Date(date)); // try to parse
|
val = val.map(date => new Date(date)); // try to parse
|
||||||
val = val.map(date => isNaN(date.getTime()) ? null : date); // check if parse passed
|
val = val.map(date => isNaN(date.getTime()) ? null : date); // check if parse passed
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (typeof val === 'string' && type.indexOf('time') !== 0){
|
} else if (typeof val === 'string' && type.indexOf('time') !== 0){
|
||||||
val = parser(val, format) || val;
|
val = parser(val, format) || val;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue