Add newer_than_absolute_date_no_time operator

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

Reviewed By: lblasa

Differential Revision: D49232773

fbshipit-source-id: 96ab2d0d5cc804c1fcf1e64475fd68de60fa797a
This commit is contained in:
Andrey Goncharov
2023-09-14 04:48:12 -07:00
committed by Facebook GitHub Bot
parent ad6b3ed4f9
commit 7a6d895aa8

View File

@@ -135,6 +135,12 @@ export const dataTablePowerSearchOperators = {
valueType: 'ABSOLUTE_DATE',
dateOnly: false,
}),
newer_than_absolute_date_no_time: () => ({
key: 'newer_than_absolute_date_no_time',
label: 'is after the day',
valueType: 'ABSOLUTE_DATE',
dateOnly: true,
}),
} satisfies {
[key: string]: (...args: any[]) => OperatorConfig;
};
@@ -205,4 +211,12 @@ export const dataTablePowerSearchOperatorProcessorConfig = {
const valueNormalized = dayjs(value);
return valueNormalized.isAfter(searchValue);
},
newer_than_absolute_date_no_time: (
_operator,
searchValue: Date,
value: any,
) => {
const valueNormalized = dayjs(value);
return valueNormalized.isAfter(searchValue);
},
} satisfies PowerSearchOperatorProcessorConfig;