Browse Source

fix(nocodb): DATEADD output format

pull/5719/head
Wing-Kam Wong 1 year ago
parent
commit
7aff612db0
  1. 2
      packages/nocodb/src/db/functionMappings/mysql.ts
  2. 2
      packages/nocodb/src/db/functionMappings/sqlite.ts

2
packages/nocodb/src/db/functionMappings/mysql.ts

@ -62,7 +62,7 @@ const mysql2 = {
DATE_FORMAT(DATE_ADD(${(await fn(pt.arguments[0])).builder}, INTERVAL
${(await fn(pt.arguments[1])).builder} ${String(
(await fn(pt.arguments[2])).builder,
).replace(/["']/g, '')}), '%Y-%m-%d %H:%i')
).replace(/["']/g, '')}), '%Y-%m-%d %H:%i:%s')
ELSE
DATE(DATE_ADD(${(await fn(pt.arguments[0])).builder}, INTERVAL
${(await fn(pt.arguments[1])).builder} ${String(

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

@ -95,7 +95,7 @@ const sqlite3 = {
builder: knex.raw(
`CASE
WHEN ${(await fn(pt.arguments[0])).builder} LIKE '%:%' THEN
STRFTIME('%Y-%m-%d %H:%M', DATETIME(DATETIME(${
STRFTIME('%Y-%m-%d %H:%M:%S', DATETIME(DATETIME(${
(await fn(pt.arguments[0])).builder
}, 'localtime'),
${dateIN > 0 ? '+' : ''}${

Loading…
Cancel
Save