1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 18:18:53 +08:00

fix csv import with ISO dates #64

This commit is contained in:
lana-k
2021-07-01 19:07:59 +02:00
parent a37ed93306
commit f9edeafd40
3 changed files with 15 additions and 8 deletions

View File

@@ -13,7 +13,14 @@ export default {
result.columns = source.meta.fields.map(col => col.trim())
result.values = source.data.map(row => {
const resultRow = []
source.meta.fields.forEach(col => { resultRow.push(row[col]) })
source.meta.fields.forEach(col => {
let value = row[col]
if (value instanceof Date) {
value = value.toISOString()
}
resultRow.push(value)
})
return resultRow
})
} else {