Browse Source

fix: pg timezone issue

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/1816/head
mertmit 3 years ago
parent
commit
8a51f40363
  1. 4
      packages/nocodb/src/lib/dataMapper/lib/sql/functionMappings/pg.ts

4
packages/nocodb/src/lib/dataMapper/lib/sql/functionMappings/pg.ts

@ -37,13 +37,13 @@ const pg = {
return knex.raw(
`CASE
WHEN CAST(${fn(pt.arguments[0])} AS text) LIKE '%:%' THEN
${fn(pt.arguments[0])} + INTERVAL '${fn(pt.arguments[1])}
${fn(pt.arguments[0])}::timestamptz + INTERVAL '${fn(pt.arguments[1])}
${String(fn(pt.arguments[2])).replace(
/["']/g,
''
)}'
ELSE
${fn(pt.arguments[0])} + INTERVAL '${fn(pt.arguments[1])}
${fn(pt.arguments[0])}::timestamptz + INTERVAL '${fn(pt.arguments[1])}
${String(fn(pt.arguments[2])).replace(/["']/g, '')}'
END${colAlias}`
);

Loading…
Cancel
Save