Browse Source

feat(nocodb): add dayjs extend

pull/5601/head
Wing-Kam Wong 2 years ago
parent
commit
00bdc1dc9d
  1. 5
      packages/nocodb-nest/src/db/CustomKnex.ts
  2. 5
      packages/nocodb-nest/src/meta/meta.service.ts

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

@ -2,10 +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);
pg.defaults.parseInputDatesAsUTC = true;
// override parsing date column to Date()

5
packages/nocodb-nest/src/meta/meta.service.ts

@ -7,6 +7,8 @@ import {
Optional,
} from '@nestjs/common';
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import timezone from 'dayjs/plugin/timezone';
import { customAlphabet } from 'nanoid';
import CryptoJS from 'crypto-js';
import { Connection } from '../connection/connection';
@ -16,6 +18,9 @@ import XcMigrationSourcev2 from './migrations/XcMigrationSourcev2';
import XcMigrationSource from './migrations/XcMigrationSource';
import type { Knex } from 'knex';
dayjs.extend(utc);
dayjs.extend(timezone);
const nanoid = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 4);
// todo: tobe fixed

Loading…
Cancel
Save