Browse Source

feat(nc-gui): display is / is not for date & datetime

pull/5185/head
Wing-Kam Wong 2 years ago
parent
commit
06aa2f78e9
  1. 12
      packages/nc-gui/utils/filterUtils.ts

12
packages/nc-gui/utils/filterUtils.ts

@ -3,7 +3,11 @@ import { UITypes, isNumericCol, numericUITypes } from 'nocodb-sdk'
const getEqText = (fieldUiType: UITypes) => {
if (isNumericCol(fieldUiType)) {
return '='
} else if ([UITypes.SingleSelect, UITypes.Collaborator, UITypes.LinkToAnotherRecord].includes(fieldUiType)) {
} else if (
[UITypes.SingleSelect, UITypes.Collaborator, UITypes.LinkToAnotherRecord, UITypes.Date, UITypes.DateTime].includes(
fieldUiType,
)
) {
return 'is'
}
return 'is equal'
@ -12,7 +16,11 @@ const getEqText = (fieldUiType: UITypes) => {
const getNeqText = (fieldUiType: UITypes) => {
if (isNumericCol(fieldUiType)) {
return '!='
} else if ([UITypes.SingleSelect, UITypes.Collaborator, UITypes.LinkToAnotherRecord].includes(fieldUiType)) {
} else if (
[UITypes.SingleSelect, UITypes.Collaborator, UITypes.LinkToAnotherRecord, UITypes.Date, UITypes.DateTime].includes(
fieldUiType,
)
) {
return 'is not'
}
return 'is not equal'

Loading…
Cancel
Save