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:
@@ -11,18 +11,18 @@ describe('csv.js', () => {
|
||||
it('getResult with fields', () => {
|
||||
const source = {
|
||||
data: [
|
||||
{ id: 1, 'name ': 'foo' },
|
||||
{ id: 2, 'name ': 'bar' }
|
||||
{ id: 1, 'name ': 'foo', date: new Date('2021-06-30T14:10:24.717Z') },
|
||||
{ id: 2, 'name ': 'bar', date: new Date('2021-07-30T14:10:15.717Z') }
|
||||
],
|
||||
meta: {
|
||||
fields: ['id', 'name ']
|
||||
fields: ['id', 'name ', 'date']
|
||||
}
|
||||
}
|
||||
expect(csv.getResult(source)).to.eql({
|
||||
columns: ['id', 'name'],
|
||||
columns: ['id', 'name', 'date'],
|
||||
values: [
|
||||
[1, 'foo'],
|
||||
[2, 'bar']
|
||||
[1, 'foo', '2021-06-30T14:10:24.717Z'],
|
||||
[2, 'bar', '2021-07-30T14:10:15.717Z']
|
||||
]
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user