Return date only as dates
This commit is contained in:
parent
5d29cfceb7
commit
eac426f3c0
|
@ -105,6 +105,9 @@ export function processDates<T extends Row | Row[]>(
|
|||
if (schema.type !== FieldType.DATETIME) {
|
||||
continue
|
||||
}
|
||||
if (schema.dateOnly) {
|
||||
continue
|
||||
}
|
||||
if (!schema.timeOnly && !schema.ignoreTimezones) {
|
||||
datesWithTZ.push(column)
|
||||
}
|
||||
|
|
|
@ -134,7 +134,11 @@ export function parse(rows: Rows, schema: TableSchema): Rows {
|
|||
if (columnType === FieldType.NUMBER) {
|
||||
// If provided must be a valid number
|
||||
parsedRow[columnName] = columnData ? Number(columnData) : columnData
|
||||
} else if (columnType === FieldType.DATETIME && !columnSchema.timeOnly) {
|
||||
} else if (
|
||||
columnType === FieldType.DATETIME &&
|
||||
!columnSchema.timeOnly &&
|
||||
!columnSchema.dateOnly
|
||||
) {
|
||||
// If provided must be a valid date
|
||||
parsedRow[columnName] = columnData
|
||||
? new Date(columnData).toISOString()
|
||||
|
|
Loading…
Reference in New Issue