I am filtering for is:complete before🙁today -365) because I want to see all the complete items that are older than a year. I would REALLY like to see the items that were COMPLETED more than a year ago, but alas that is the discussion in another thread, right now is the closest I can get.
However I am getting only completed items dated from June 30,2020 to February 11 (today) and they are only a few.
There is a huge difference here in how the parser is treating the “-” symbol.
If I surround it with spaces such as “is:complete before🙁today-365)” I get nothing.
If I put the spaces in such as “is:complete before🙁today - 365)” I get 19 items. I clearly have hundreds and hundreds of items that had due dates older than one year ago, so this is clearly wrong.
Summarily there are the following issues:
- Using the “-” symbol with and without spaces around is being interpreted differently. Spaces should be treated as white spaces and completely ignored by the parser, they are just useful for human clarity.
- Using the “-” symbol has two interpretations (the boolean NOT operator and the minus symbol of a numerical expression intended to substract a number). This is not good as it relies on context to derive interpretation and with complex expressions it will be almost impossible to see how complex expressions can get. It would be better to use a different symbol for the NOT operator that doesn’t clash with arithmetic symbols . For example ! is commonly use as NOT shortcut in most computer languages. One could argue that it is the factorial symbol in arithmetic, but I don’t think anyone would be using a factorial operation in the filter expression.
Even better simply accept the not keyword for negating filtering results. It’s just 3 letters and provides more clarity of intent of use
- The “today - 365” should be a valid expression, so it’s definitely interpreting wrong the date filter (or I am not understanding correctly how to use the date filters).