Browse Source

fix(nocodb): move parsing logic out of type parser

pull/5601/head
Wing-Kam Wong 2 years ago
parent
commit
4cb842b61a
  1. 7
      packages/nocodb-nest/src/db/CustomKnex.ts

7
packages/nocodb-nest/src/db/CustomKnex.ts

@ -2,20 +2,15 @@ import { Knex, knex } from 'knex';
import { SnowflakeClient } from 'nc-help';
import pg, { types } from 'pg';
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import timezone from 'dayjs/plugin/timezone';
import Filter from '../models/Filter';
import type { FilterType } from 'nocodb-sdk';
import type { BaseModelSql } from './BaseModelSql';
dayjs.extend(utc);
dayjs.extend(timezone);
// override parsing date column to Date()
types.setTypeParser(1082, (val) => val);
// override timestamp
types.setTypeParser(1114, (val) => {
return dayjs(val).utc(true).local().format('YYYY-MM-DD HH:mm:ssZ');
return dayjs(val).format('YYYY-MM-DD HH:mm:ss');
});
const opMappingGen = {

Loading…
Cancel
Save