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:
committed by
Facebook GitHub Bot
parent
7d90493148
commit
1cf7160b2c
@@ -153,6 +153,12 @@ export const dataTablePowerSearchOperators = {
|
|||||||
valueType: 'ABSOLUTE_DATE',
|
valueType: 'ABSOLUTE_DATE',
|
||||||
dateOnly: true,
|
dateOnly: true,
|
||||||
}),
|
}),
|
||||||
|
same_as_absolute_date_no_time: () => ({
|
||||||
|
key: 'same_as_absolute_date_no_time',
|
||||||
|
label: 'is',
|
||||||
|
valueType: 'ABSOLUTE_DATE',
|
||||||
|
dateOnly: true,
|
||||||
|
}),
|
||||||
} satisfies {
|
} satisfies {
|
||||||
[key: string]: (...args: any[]) => OperatorConfig;
|
[key: string]: (...args: any[]) => OperatorConfig;
|
||||||
};
|
};
|
||||||
@@ -243,4 +249,8 @@ export const dataTablePowerSearchOperatorProcessorConfig = {
|
|||||||
const valueNormalized = dayjs(value);
|
const valueNormalized = dayjs(value);
|
||||||
return valueNormalized.isBefore(searchValue);
|
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;
|
} satisfies PowerSearchOperatorProcessorConfig;
|
||||||
|
|||||||
Reference in New Issue
Block a user