Browse Source

refactor(nocodb): add / revise comments

pull/5642/head
Wing-Kam Wong 2 years ago
parent
commit
a8d05f2da4
  1. 2
      packages/nocodb/src/models/Model.ts
  2. 5
      packages/nocodb/src/version-upgrader/ncDateTimeUpgrader.ts

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

@ -488,7 +488,7 @@ export default class Model implements TableType {
.format('YYYY-MM-DD HH:mm:ssZ');
}
} else {
// TODO(timezone): keep ext db as it is
// External DB - keep it as it is
val = dayjs(val).format(
isMySQL ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD HH:mm:ssZ',
);

5
packages/nocodb/src/version-upgrader/ncDateTimeUpgrader.ts

@ -28,6 +28,11 @@ function getTnPath(knex: XKnex, tb: Model) {
}
}
// This upgrader is to update all datetime fields in xcdb base due to the datetime changes
// ref: https://github.com/nocodb/nocodb/pull/5505
// Originally, for XCDB-based projects, we store the local time in DB and display local time in UI
// After the above PR, we store UTC time in DB and display local time in UI
// Therefore, we convert all the target datetime to UTC format in DB
export default async function ({ ncMeta }: NcUpgraderCtx) {
const bases: BaseType[] = await ncMeta.metaList2(null, null, MetaTable.BASES);
for (const _base of bases) {

Loading…
Cancel
Save