Help with filter syntax for days operator

Hi,

Unfortunately for me the days operator does not offer mutual exclusivity in the following filters.

The value interval3 is stored on each tiddler as an integer field, it is given a negative value for instance
-30

Here are my two filters, the difference between the two is the ! operator before the days operator, the first conditional tests if a tiddler is overdue and needs a review, the second tests if a tiddler does not require a review because it has been reviewed sufficiently recently.

If I wanted to review a tiddler every 30 days the value stored in the field interval3 would be -30.

<$list filter=’[all[current]!is[system]has:field[last-reviewed3]days:last-reviewed3{!!interval3}]’>

<$list filter=’[all[current]!is[system]has:field[last-reviewed3]!days:last-reviewed3{!!interval3}]’>

These filters are used to determine if a tiddler requires a review based on days elapsed since last review.

The problem I have is that the days operator returns true for both !days and days on the first day on which the tiddler needs review, I require mutual exclusivity between these two filters.

The problem from my perspective lies in the days operator itself as it does not play nice with code that is attempting “if then else” logic but that’s unlikely to change so I need to work around the issue.

The way I would like to solve this is to alter the value used in the last part of the first filter so that in pseudo code it made this test, the pseudo code is the…

!!interval3 -1

… part so if interval3 has a stored value of -30 I want to make the days comparison using the value -31.

pseudo code
<$list filter=’[all[current]!is[system]has:field[last-reviewed3]days:last-reviewed3{ !!interval3 -1 }]’>

Just struggling with this last aspect of my “review tiddlers” plugin at the moment two buttons appear on the tiddler toolbar which should be mutually exclusive, I’d like to polish off this one issue.

Thanks…

If you don’t find a solution in the next 10 hours I may return and respond in detail :sleeping: however some quick tips;

  • The days operator is very powerful, but somewhat mind bending. Do little partial tests as you explore them.
  • It is very common to combine two days operators together
  • Days operators are often like picking a number on a number line and drawing an arrow to the left or right such that all number smaller, or all numbers greater are selected.
    • The direction of this can be flipped with the ! and my experience is we humans find multiple binary combinations confusing, just look at how many people use “double negatives”

A double negative is a statement which contains two negative words. If two negatives are used in one sentence, the opposite meaning may be conveyed.

eg; Positive