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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ea1d2e9813
commit
7d90493148
@@ -147,6 +147,12 @@ export const dataTablePowerSearchOperators = {
|
|||||||
valueType: 'ABSOLUTE_DATE',
|
valueType: 'ABSOLUTE_DATE',
|
||||||
dateOnly: false,
|
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 {
|
} satisfies {
|
||||||
[key: string]: (...args: any[]) => OperatorConfig;
|
[key: string]: (...args: any[]) => OperatorConfig;
|
||||||
};
|
};
|
||||||
@@ -229,4 +235,12 @@ export const dataTablePowerSearchOperatorProcessorConfig = {
|
|||||||
const valueNormalized = dayjs(value);
|
const valueNormalized = dayjs(value);
|
||||||
return valueNormalized.isBefore(searchValue);
|
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;
|
} satisfies PowerSearchOperatorProcessorConfig;
|
||||||
|
|||||||
Reference in New Issue
Block a user