If one of two conditions are met

Hi,

I’ve got a list of conditions which if all true, produce a message.

I want one of the conditions to be met if Today is Thursday or Friday.

So far, I’ve worked out how to do it for one of the days, but not for both.

In a field marked ‘today’ I’ve got <<now DDD>>

and in the body of the tiddler:

<$wikify name="today" text={{!!today}}>

The condition is:

<% if [<today>compare:string:eq[Thursday]]%>

True

<% endif %>

There’s probably a better way of doing it as well.

Any suggestions much appreciated.

Jon

Unless there is some specific reason for using a field containing <<now DDD>>, you can skip the field AND the $wikify widget, and just write:

<% if [<now DDD>match[Thursday]] [<now DDD>match[Friday]] %>

True

<% endif %>

Notes:

  • Use two filter runs to test for “Thursday” OR “Friday”
  • Both filter runs are evaluated. For any given day, only one of the two filter runs will produce output (or no output at all if it is neither Thursday or Friday)
  • Use the simpler match[...] filter operator to compare with literal string values
2 Likes

Thanks Eric - that’s much better and I can see now how to write the 2 filter runs.

Many thanks
Jon