Use real dae object for default date value if already parsed

This commit is contained in:
Andrew Kingston 2021-08-04 15:33:33 +01:00
parent c0ca68cb83
commit 25ae109e72
1 changed files with 4 additions and 1 deletions

View File

@ -17,7 +17,10 @@
return null
}
let date
if (isNaN(val)) {
if (val instanceof Date) {
// Use real date obj if already parsed
date = val
} else if (isNaN(val)) {
// Treat as date string of some sort
date = new Date(val)
} else {