CLI2: New filter attribute modifier "by", uses '<=' for comparison

This patch allows e.g. due.by:tomorrow that includes all of tomorrow,
because it uses less than or equal to, rather than just less than, like
'before' modifier does.  This allows matching the last second of the day
when filtering by "due.by:eod", and more generally allows date filters
with an inclusive end-interval specification.

Closes #2536
This commit is contained in:
Scott Mcdermott 2021-07-17 17:22:41 -07:00 committed by Tomas Babej
parent af6f2b55ec
commit ac3572a4f5
2 changed files with 6 additions and 0 deletions

View file

@ -1341,6 +1341,11 @@ void CLI2::desugarFilterAttributes ()
op.attribute ("raw", ">");
rhs.attribute ("raw", value);
}
else if (mod == "by")
{
op.attribute ("raw", "<=");
rhs.attribute ("raw", value);
}
else if (mod == "none")
{
op.attribute ("raw", "==");

View file

@ -397,6 +397,7 @@ static const char* modifierNames[] =
{
"before", "under", "below",
"after", "over", "above",
"by",
"none",
"any",
"is", "equals",