diff --git a/frontend/src/scenes/cohorts/CohortFilters/constants.tsx b/frontend/src/scenes/cohorts/CohortFilters/constants.tsx index e1f5c7b53bfbd..5db9872a4cca5 100644 --- a/frontend/src/scenes/cohorts/CohortFilters/constants.tsx +++ b/frontend/src/scenes/cohorts/CohortFilters/constants.tsx @@ -39,6 +39,7 @@ import { FilterLogicalOperator, PropertyMathType, PropertyOperator, + SingleFieldDateType, TimeUnitType, ValueOptionType, } from '~/types' @@ -200,6 +201,21 @@ export const FIELD_VALUES: Record = { }, }, }, + [FieldOptionsType.SingleFieldDateOperators]: { + label: 'Date Operators', + type: FieldOptionsType.SingleFieldDateOperators, + values: { + [SingleFieldDateType.IsDateExact]: { + label: 'on the date', + }, + [SingleFieldDateType.IsDateAfter]: { + label: 'since', + }, + [SingleFieldDateType.IsDateBefore]: { + label: 'before', + }, + }, + }, [FieldOptionsType.MathOperators]: { label: 'Operators', type: FieldOptionsType.MathOperators, @@ -861,7 +877,12 @@ export const renderField: Record JSX.El return }, [FilterType.MathOperator]: function _renderField(p) { - return + return ( + + ) }, [FilterType.EventsAndActionsMathOperator]: function _renderField(p) { return diff --git a/frontend/src/scenes/cohorts/CohortFilters/types.ts b/frontend/src/scenes/cohorts/CohortFilters/types.ts index 2b9f753b15558..590e553c5767a 100644 --- a/frontend/src/scenes/cohorts/CohortFilters/types.ts +++ b/frontend/src/scenes/cohorts/CohortFilters/types.ts @@ -42,6 +42,7 @@ export enum FieldOptionsType { LifecycleBehavioral = 'lifecycleBehavioral', TimeUnits = 'timeUnits', DateOperators = 'dateOperators', + SingleFieldDateOperators = 'singleFieldDateOperators', MathOperators = 'mathOperators', ValueOptions = 'valueOptions', EventsAndActionsMathOperators = 'eventsAndActionsMathOperators', diff --git a/frontend/src/types.ts b/frontend/src/types.ts index f6a4594b26577..51fb1e866b4c0 100644 --- a/frontend/src/types.ts +++ b/frontend/src/types.ts @@ -3500,6 +3500,12 @@ export enum DateOperatorType { IsNotSet = 'is_not_set', } +export enum SingleFieldDateType { + IsDateExact = 'is_date_exact', + IsDateBefore = 'is_date_before', + IsDateAfter = 'is_date_after', +} + export enum ValueOptionType { MostRecent = 'most_recent', Previous = 'previous',