Browse Source

fix(nocodb): revise sqlite DATEADD time format and convert to utc

pull/5689/head
Wing-Kam Wong 1 year ago
parent
commit
f34463bed2
  1. 6
      packages/nocodb/src/db/functionMappings/sqlite.ts

6
packages/nocodb/src/db/functionMappings/sqlite.ts

@ -95,9 +95,9 @@ const sqlite3 = {
builder: knex.raw(
`CASE
WHEN ${(await fn(pt.arguments[0])).builder} LIKE '%:%' THEN
STRFTIME('%Y-%m-%d %H:%M:%S', DATETIME(DATETIME(${
STRFTIME('%Y-%m-%dT%H:%M:%fZ', DATETIME(DATETIME(${
(await fn(pt.arguments[0])).builder
}, 'localtime'),
}, 'utc'),
${dateIN > 0 ? '+' : ''}${
(await fn(pt.arguments[1])).builder
} || ' ${String((await fn(pt.arguments[2])).builder).replace(
@ -105,7 +105,7 @@ const sqlite3 = {
'',
)}'))
ELSE
DATE(DATETIME(${(await fn(pt.arguments[0])).builder}, 'localtime'),
DATE(DATETIME(${(await fn(pt.arguments[0])).builder}),
${dateIN > 0 ? '+' : ''}${
(await fn(pt.arguments[1])).builder
} || ' ${String((await fn(pt.arguments[2])).builder).replace(

Loading…
Cancel
Save