From 7d90493148d2a0f3e0c1ca4f8bd7e5df0fca3b5b Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Thu, 14 Sep 2023 04:48:12 -0700 Subject: [PATCH] Add older_than_absolute_date_no_time operator Summary: Doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU/edit#heading=h.pg8svtdjlx7 Reviewed By: antonk52 Differential Revision: D49232776 fbshipit-source-id: 1083c277c78cd6eb2bae069966a9de290aa71930 --- .../DataTableDefaultPowerSearchOperators.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/desktop/flipper-plugin/src/ui/data-table/DataTableDefaultPowerSearchOperators.tsx b/desktop/flipper-plugin/src/ui/data-table/DataTableDefaultPowerSearchOperators.tsx index a319af880..440c4ca37 100644 --- a/desktop/flipper-plugin/src/ui/data-table/DataTableDefaultPowerSearchOperators.tsx +++ b/desktop/flipper-plugin/src/ui/data-table/DataTableDefaultPowerSearchOperators.tsx @@ -147,6 +147,12 @@ export const dataTablePowerSearchOperators = { valueType: 'ABSOLUTE_DATE', dateOnly: false, }), + older_than_absolute_date_no_time: () => ({ + key: 'older_than_absolute_date_no_time', + label: 'is before the day', + valueType: 'ABSOLUTE_DATE', + dateOnly: true, + }), } satisfies { [key: string]: (...args: any[]) => OperatorConfig; }; @@ -229,4 +235,12 @@ export const dataTablePowerSearchOperatorProcessorConfig = { const valueNormalized = dayjs(value); return valueNormalized.isBefore(searchValue); }, + older_than_absolute_date_no_time: ( + _operator, + searchValue: Date, + value: any, + ) => { + const valueNormalized = dayjs(value); + return valueNormalized.isBefore(searchValue); + }, } satisfies PowerSearchOperatorProcessorConfig;