Browse Source

fix: handle formula which outputs datetime as result

pull/7574/head
Pranav C 8 months ago
parent
commit
d9626f5d25
  1. 10
      packages/nocodb/src/db/conditionV2.ts

10
packages/nocodb/src/db/conditionV2.ts

@ -1,5 +1,6 @@
import { import {
FormulaDataTypes, FormulaDataTypes,
getEquivalentUIType,
isDateMonthFormat, isDateMonthFormat,
isNumericCol, isNumericCol,
RelationTypes, RelationTypes,
@ -574,6 +575,9 @@ const parseConditionV2 = async (
: 'YYYY-MM-DD HH:mm:ssZ'; : 'YYYY-MM-DD HH:mm:ssZ';
if ( if (
(column.uidt === UITypes.Formula &&
getEquivalentUIType({ formulaColumn: column.colOptions }) ==
UITypes.DateTime) ||
[ [
UITypes.Date, UITypes.Date,
UITypes.DateTime, UITypes.DateTime,
@ -668,6 +672,9 @@ const parseConditionV2 = async (
case 'eq': case 'eq':
if (qb?.client?.config?.client === 'mysql2') { if (qb?.client?.config?.client === 'mysql2') {
if ( if (
(column.uidt === UITypes.Formula &&
getEquivalentUIType({ formulaColumn: column.colOptions }) ==
UITypes.DateTime) ||
[ [
UITypes.Duration, UITypes.Duration,
UITypes.Currency, UITypes.Currency,
@ -692,6 +699,9 @@ const parseConditionV2 = async (
} }
} else { } else {
if ( if (
(column.uidt === UITypes.Formula &&
getEquivalentUIType({ formulaColumn: column.colOptions }) ==
UITypes.DateTime) ||
[ [
UITypes.DateTime, UITypes.DateTime,
UITypes.CreatedTime, UITypes.CreatedTime,

Loading…
Cancel
Save