From 34f8e9b61377f0b00695404158cbe898cc64c79e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Fri, 27 Sep 2024 15:53:57 +0200 Subject: [PATCH] Is this used? --- .../ObjectFilterDropdownDateInput.tsx | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownDateInput.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownDateInput.tsx index 23839ccbbe37..3961f28c836b 100644 --- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownDateInput.tsx +++ b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownDateInput.tsx @@ -12,9 +12,8 @@ import { VariableDateViewFilterValueUnit, } from '@/views/utils/view-filter-value/resolveDateViewFilterValue'; import { resolveFilterValue } from '@/views/utils/view-filter-value/resolveFilterValue'; -import { useEffect, useState } from 'react'; +import { useState } from 'react'; import { isDefined } from 'twenty-ui'; -import { z } from 'zod'; import { FieldMetadataType } from '~/generated-metadata/graphql'; export const ObjectFilterDropdownDateInput = () => { @@ -48,29 +47,6 @@ export const ObjectFilterDropdownDateInput = () => { const isDateTimeInput = filterDefinitionUsedInDropdown?.type === FieldMetadataType.DateTime; - useEffect(() => { - if (selectedFilter?.operand !== ViewFilterOperand.IsRelative) { - if (!filterDefinitionUsedInDropdown || !selectedOperandInDropdown) return; - - const now = new Date(); - const dateResult = z.coerce.date().safeParse(selectedFilter?.value); - const date = dateResult.success ? dateResult.data : now; - const value = date.toISOString(); - const displayValue = isDateTimeInput - ? date.toLocaleString() - : date.toLocaleDateString(); - - selectFilter?.({ - id: selectedFilter?.id ? selectedFilter.id : v4(), - fieldMetadataId: filterDefinitionUsedInDropdown.fieldMetadataId, - value, - displayValue, - operand: selectedOperandInDropdown, - definition: filterDefinitionUsedInDropdown, - }); - } - }, [selectedOperandInDropdown]); - const handleAbsoluteDateChange = (newDate: Date | null) => { setInternalDate(newDate);