Browse Source

fix(nocodb): revise mapAliasToColumn for mysql external db

pull/5642/head
Wing-Kam Wong 2 years ago
parent
commit
942993e7a9
  1. 12
      packages/nocodb/src/models/Model.ts

12
packages/nocodb/src/models/Model.ts

@ -488,10 +488,14 @@ export default class Model implements TableType {
.format('YYYY-MM-DD HH:mm:ssZ'); .format('YYYY-MM-DD HH:mm:ssZ');
} }
} else { } else {
// External DB - keep it as it is // External DB
val = dayjs(val).format( if (isMySQL) {
isMySQL ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD HH:mm:ssZ', // convert to utc
); val = dayjs(val).utc().format('YYYY-MM-DD HH:mm:ss');
} else {
// keep it as it is
val = dayjs(val).format('YYYY-MM-DD HH:mm:ssZ');
}
} }
} }
insertObj[sanitize(col.column_name)] = val; insertObj[sanitize(col.column_name)] = val;

Loading…
Cancel
Save