[TW5] Variables in List Filter

138 views
Skip to first unread message

Bastian

unread,
Jul 20, 2016, 10:24:36 AM7/20/16
to TiddlyWiki
Hi,

I'd like to get a list of all Tiddlers, that have the field "due" which has the value of the current date.

That's the code I have so far:

<$set name=today value=<<now 0DD.0MM.YYYY>>>
<<today>>
</$set>


<$list filter="[due[<today>]]">

<$checkbox tag="done"> <$link to={{!!title}}><$view field="title"/></$link> <$list filter="[is[current]tags[]regexp[PRIO0|onhold|BLOCKED]]">{{||$:/core/ui/TagTemplate}}</$list> </$checkbox>
</$list>

The setting of the variable "today" works, as the output of it works, but when I use it in the filter, it doesn't work.
On the other hand, when I put in the date, e.g. "20.07.2016" I get results.

I not only tried "[due[<today>]]" but also "[due<today>]", "[due[{today}]]".

What do I do wrong?

Regards,
Bastian

Mark S.

unread,
Jul 20, 2016, 11:24:41 AM7/20/16
to TiddlyWiki
A variable set by <$set> is only good inside the <$set>...</$set> tag pair. Move </$set> to the bottom of the tiddler and see if your results are better.

Mark

Evolena

unread,
Jul 20, 2016, 1:21:22 PM7/20/16
to TiddlyWiki
Hello,

Beside Mark's answer,
 
I not only tried "[due[<today>]]" but also "[due<today>]", "[due[{today}]]".

 the right syntax is [due<today>].

c pa

unread,
Jul 20, 2016, 2:17:08 PM7/20/16
to TiddlyWiki
This works on tiddlywiki.com as long as you do the following:
Create New tiddler 1, new tiddler 2 etc.
add the field due
set due = "20.07.2016"      - or today's date string returned


<$set name=today value=<<now 0DD.0MM.YYYY>>>
    <<today>>
    <$list filter="[due<today>]">

        <$checkbox tag="done">
            <$link to={{!!title}}>
                <$view field="title"/>
            </$link>
            <$list filter="[is[current]tags[]regexp[PRIO0|onhold|BLOCKED]]">
                {{||$:/core/ui/TagTemplate}}
            </$list>
        </$checkbox>
    </$list>
</$set>

Bastian

unread,
Jul 21, 2016, 2:33:18 AM7/21/16
to TiddlyWiki
Dang!
That's it!
Thank You Mark S.!
Now I know why the variable didn't work!

Problem solved.
Thanks also for the hint with the right Syntax in filters. That helped!

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