Browse Source

fix(nocodb): blank for date / datetime type

pull/5185/head
Wing-Kam Wong 2 years ago
parent
commit
9b40533bd8
  1. 13
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts

13
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts

@ -8,10 +8,11 @@ import genRollupSelectv2 from './genRollupSelectv2';
import RollupColumn from '../../../../models/RollupColumn';
import formulaQueryBuilderv2 from './formulav2/formulaQueryBuilderv2';
import FormulaColumn from '../../../../models/FormulaColumn';
import { RelationTypes, UITypes, isNumericCol } from 'nocodb-sdk';
import { isNumericCol, RelationTypes, UITypes } from 'nocodb-sdk';
import { sanitize } from './helpers/sanitize';
import dayjs, { extend } from 'dayjs';
import customParseFormat from 'dayjs/plugin/customParseFormat.js';
extend(customParseFormat);
export default async function conditionV2(
@ -634,7 +635,10 @@ const parseConditionV2 = async (
.orWhere(field, 'null');
} else {
qb = qb.whereNull(customWhereClause || field);
if (!isNumericCol(column.uidt)) {
if (
!isNumericCol(column.uidt) &&
![UITypes.Date, UITypes.DateTime].includes(column.uidt)
) {
qb = qb.orWhere(field, '');
}
}
@ -647,7 +651,10 @@ const parseConditionV2 = async (
.whereNot(field, 'null');
} else {
qb = qb.whereNotNull(customWhereClause || field);
if (!isNumericCol(column.uidt)) {
if (
!isNumericCol(column.uidt) &&
![UITypes.Date, UITypes.DateTime].includes(column.uidt)
) {
qb = qb.whereNot(field, '');
}
}

Loading…
Cancel
Save