Show some content only the 1st day of the month

45 views
Skip to first unread message

Luis Gonzalez

unread,
Nov 28, 2019, 4:06:16 AM11/28/19
to TiddlyWiki
I want to show some tasks inside a planning tiddler but only if it is the first day of the month.

I think is necessary to use the <<now>> macro.
I've tried with the reveal widget and with filters but nothing works.

Luis Gonzalez

unread,
Nov 28, 2019, 4:20:55 AM11/28/19
to TiddlyWiki
I found the solution!!!
The tiddler [[First day tasks]] has the content I want to show the first day of each month.

With this code we show the content of the tiddler [[First day tasks]] only if today has the value 1. Else, it shows "no tasks".

<$set name="today" value=<<now DD>>>
<$set name="one" value="1">
  <$list filter="[
<today>match<one>]"  emptyMessage="no tasks">
    [[First day tasks]]
    <$wikify name="texto" text={{First day tasks}} output="html">
    <
<texto>>
    </$wikify>
  </$list>
</$set>
</$set>



Hubert

unread,
Nov 28, 2019, 6:29:35 AM11/28/19
to TiddlyWiki
Hi Luis,

Generally, the reveal widget will be more efficient than most filters. The below code should work as well, though you might need to adjust its output if needed.

<$reveal default=<<now DD>> type="match" text="1">
{{First day tasks}}
</$reveal>
<$reveal default=<
<now DD>> type="nomatch" text="1">
no tasks
</$reveal>

Regards,
Hubert
Reply all
Reply to author
Forward
0 new messages