Browse Source

chore: date/datetime comparison correction - MySQL

pull/6507/head
Pranav C 1 year ago
parent
commit
e40830954e
  1. 2
      packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue
  2. 6
      packages/nocodb/src/db/conditionV2.ts

2
packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue

@ -10,11 +10,11 @@ import {
computed, computed,
iconMap, iconMap,
inject, inject,
onMounted,
ref, ref,
useNuxtApp, useNuxtApp,
useViewFilters, useViewFilters,
watch, watch,
onMounted
} from '#imports' } from '#imports'
import type { Filter } from '#imports' import type { Filter } from '#imports'

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

@ -460,7 +460,11 @@ const parseConditionV2 = async (
].includes(column.uidt) ].includes(column.uidt)
) { ) {
qb = qb.where(field, val); qb = qb.where(field, val);
} else if (column.ct === 'timestamp' || column.ct === 'date' || column.ct === 'datetime') { } else if (
column.ct === 'timestamp' ||
column.ct === 'date' ||
column.ct === 'datetime'
) {
qb = qb.where(knex.raw('DATE(??) = DATE(?)', [field, val])); qb = qb.where(knex.raw('DATE(??) = DATE(?)', [field, val]));
} else { } else {
// mysql is case-insensitive for strings, turn to case-sensitive // mysql is case-insensitive for strings, turn to case-sensitive

Loading…
Cancel
Save