Browse Source

fix(nocodb): format date in API response

pull/6870/head
աɨռɢӄաօռɢ 1 year ago
parent
commit
ce71fd5caf
  1. 6
      packages/nocodb/src/db/BaseModelSqlv2.ts

6
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -8,7 +8,6 @@ import { nocoExecute } from 'nc-help';
import { import {
AuditOperationSubTypes, AuditOperationSubTypes,
AuditOperationTypes, AuditOperationTypes,
isDateMonthFormat,
isLinksOrLTAR, isLinksOrLTAR,
isSystemColumn, isSystemColumn,
isVirtualCol, isVirtualCol,
@ -4512,11 +4511,12 @@ class BaseModelSqlv2 {
if (col.uidt === UITypes.Date) { if (col.uidt === UITypes.Date) {
const dateFormat = col.meta?.date_format; const dateFormat = col.meta?.date_format;
if (dateFormat && isDateMonthFormat(dateFormat)) { if (dateFormat) {
d[col.title] = dayjs(d[col.title], dateFormat).format(dateFormat); d[col.title] = dayjs(d[col.title], dateFormat).format(dateFormat);
continue;
} }
continue;
} }
let keepLocalTime = true; let keepLocalTime = true;
if (this.isSqlite) { if (this.isSqlite) {

Loading…
Cancel
Save