Merge branch 'delete-sql-spec-ts-2' of github.com:budibase/budibase into delete-sql-spec-ts-2
This commit is contained in:
commit
a9e2e151fc
|
@ -177,7 +177,7 @@ export const stringifyDate = (
|
|||
const year = value.year()
|
||||
const month = `${value.month() + 1}`.padStart(2, "0")
|
||||
const day = `${value.date()}`.padStart(2, "0")
|
||||
return `${year}-${month}-${day}T00:00:00.000`
|
||||
return `${year}-${month}-${day}`
|
||||
}
|
||||
|
||||
// Otherwise use a normal ISO string with time and timezone
|
||||
|
|
|
@ -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