Add same_as_absolute_date_no_time operator

Summary: Doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU/edit#heading=h.pg8svtdjlx7

Reviewed By: lblasa, antonk52

Differential Revision: D49232775

fbshipit-source-id: 0ad6fafdd998f79a8b96bf9cd9d6e012e6e3a492
This commit is contained in:
Andrey Goncharov
2023-09-14 04:48:12 -07:00
committed by Facebook GitHub Bot
parent 7d90493148
commit 1cf7160b2c

View File

@@ -153,6 +153,12 @@ export const dataTablePowerSearchOperators = {
valueType: 'ABSOLUTE_DATE',
dateOnly: true,
}),
same_as_absolute_date_no_time: () => ({
key: 'same_as_absolute_date_no_time',
label: 'is',
valueType: 'ABSOLUTE_DATE',
dateOnly: true,
}),
} satisfies {
[key: string]: (...args: any[]) => OperatorConfig;
};
@@ -243,4 +249,8 @@ export const dataTablePowerSearchOperatorProcessorConfig = {
const valueNormalized = dayjs(value);
return valueNormalized.isBefore(searchValue);
},
same_as_absolute_date_no_time: (_operator, searchValue: Date, value: any) => {
const valueNormalized = dayjs(value);
return valueNormalized.isSame(searchValue, 'day');
},
} satisfies PowerSearchOperatorProcessorConfig;