Merge pull request #2172 from SergioCrisostomo/fix-2164
format string dates in daterange also
This commit is contained in:
commit
c61015d19d
3 changed files with 50 additions and 2 deletions
|
@ -513,7 +513,7 @@
|
|||
|
||||
if (val && type === 'time' && !(val instanceof Date)) {
|
||||
val = parser(val, this.format || DEFAULT_FORMATS[type]);
|
||||
} else if (val && type === 'timerange' && Array.isArray(val) && val.length === 2 && !(val[0] instanceof Date) && !(val[1] instanceof Date)) {
|
||||
} else if (val && type.match(/range$/) && Array.isArray(val) && val.filter(Boolean).length === 2 && !(val[0] instanceof Date) && !(val[1] instanceof Date)) {
|
||||
val = val.join(RANGE_SEPARATOR);
|
||||
val = parser(val, this.format || DEFAULT_FORMATS[type]);
|
||||
} else if (typeof val === 'string' && type.indexOf('time') !== 0 ){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue