How to filter by due date of today in shiraz dynamic table

I was using dynamic table from shiraz for creating a reading list (with due date). How to filter only those tiddlers which have today as due-date in that.

You can use search with dynamic table! There are few example in Shiraz! The example filter result by searching in title, you need to use it with due-date!

Example can be found here

https://kookma.github.io/TW-Shiraz/#demo%2Fdynamic-tables%2Fsearchable

I just need to know what I should add in the filter for displaying only the tiddlers with due-date as todays date

So, you do not need to interactively filter!

If so, then you have to pass your filter when you call table-dynamic! For example see below snippet:

<$macrocall $name=table-dynamic filter="""[prefix[Job]tag[task]] :filter[get[due-date]match<now "YYYY-0MM-0DD">]""" fields="tbl-checkbox tbl-expand title description priority status due-date tags" class="w-100" stateTiddler="your-state-tid"/>

Note to :filter[get[due-date]match<now "YYYY-0MM-0DD">]

1 Like

How to add search option into this code

Given below is the code I use for the searchable dynamic table in my reading list tiddler .

Filter and search in table <$edit-text tiddler="$:/temp/demo/dtable/search" filed=text tag=input default=""/> <$button set="$:/temp/demo/dtable/search" setTo="" tooltip="clear searchbox">x</$button>
<$macrocall $name=table-dynamic filter="[tag[Readinglist]search{$:/temp/demo/dtable/search}]" class="w-100 thead-dark table-center" fields="tbl-checkbox tbl-expand title priority status due-date location" pagination="yes" caption="''title''">>

Where should I add search{$:/temp/demo/dtable/search} to the code given by you to make it searchable

To the main filter: for example for [prefix[Job]tag[task]] write

filter="[prefix[Job]tag[task]search{$:/temp/demo/dtable/search}] :filter[get[due-date]match<now "YYYY-0MM-0DD">]"
1 Like

Thank you @Mohammad for the quick replies and help.

I am using this filter in Journal tiddler. As mentioned in this discussion, i am using Eric’s Calendar to create Journal tiddler which will automatically add a field journal-date which will be the date corresponding to that particular day.

How to modify the filter given by you so that the due-date match the journal-date rather than today. I need this because if i use due-date match today, the filter output will be empty if i want to check my previous day’s journal on the next day.

@Mohammad can you please guide?

Hi @arunnbabu81
I missed this post!

In prevous solution

filter="[prefix[Job]tag[task]search{$:/temp/demo/dtable/search}] :filter[get[due-date]match<now "YYYY-0MM-0DD">]"

This part does the trick

:filter[get[due-date]match<now "YYYY-0MM-0DD">

This time you want to compare the due-date with journal-date so, I think you need
this

:filter[get[due-date]match{!!journal-date}]

This is not tested and assume the format of date for both field is the same!

If you could provide a minimum example, then I can be more helfulp.

2 Likes

I am not able to get it right. Will show a demo wiki when i am back on my laptop

Yes, please provide a minimum example with exactly what you want.

same outcome but shorter and theoretically faster:
:filter[due-date{!!journal-date}]

2 Likes

I have a reading list tiddler in my wiki based on shiraz dynamic table.

I use tiddlyclip to send webpages (iframe embedded within the tiddlers) to the Reading List tiddler by tagging them with “Readinglist”

i use the code given blow for the dynamic table in the Reading List tiddler to get all tiddlers with the tag “Readinglist”

Filter and search in table <$edit-text tiddler="$:/temp/demo/dtable/search" filed=text tag=input default=""/> <$button set="$:/temp/demo/dtable/search" setTo="" tooltip="clear searchbox">x</$button>

<$macrocall $name=table-dynamic filter="[tag[Readinglist]search{$:/temp/demo/dtable/search}]" class="w-100 thead-dark table-center" fields="tbl-checkbox tbl-expand title priority status due-date location" pagination="yes" caption="''title''">>

I also have daily Journal tiddlers. These Journal tiddlers have field called journal-date.

journal-date is a field which is automatically added to all journal tiddlers i create from Eric’s Calendar with the help of TiddlyTools/Time/JournalListChanges. Refer to these discussion - 1 and 2

This how it looks

image

I want to list in the Journal tiddler, only those reading list tiddlers which have due-date same as that of the Journal date.

I tried this code given by @Mohammad which filter tiddlers whose due-date match today

!Reading list 
Filter and search in table <$edit-text tiddler="$:/temp/demo/dtable/search" filed=text tag=input default=""/> <$button set="$:/temp/demo/dtable/search" setTo="" tooltip="clear searchbox">x</$button>

<$macrocall $name=table-dynamic filter="""[tag[Readinglist]search{$:/temp/demo/dtable/search}] :filter[get[due-date]match<now "YYYY-0MM-0DD">]""" class="w-100 thead-dark float-right" fields="tbl-checkbox tbl-expand title priority status due-date location" pagination="yes" caption="''title''">>

This one was working. But i had another problem with this one - if i want to check the previous day journal for seeing the pending reading list tiddlers, it wont be seen.

Then i thought its better to match the due-date with the date in the journal-field of the Journal tiddler.

I tried these code given by Mohammed and Saq for using the journal-date instead of now, but its not working on my side.

<$macrocall $name=table-dynamic filter="""[tag[Readinglist]search{$:/temp/demo/dtable/search}]:filter[get[due-date]match{!!journal-date}]""" class="w-100 thead-dark" fields="tbl-checkbox tbl-expand title priority status due-date location" pagination="yes" caption="''title''">>
<$macrocall $name=table-dynamic filter="""[tag[Readinglist]search{$:/temp/demo/dtable/search}] :filter[due-date{!!journal-date}]""" class="w-100 thead-dark" fields="tbl-checkbox tbl-expand title priority status due-date location" pagination="yes" caption="''title''">>

This is what i see in today Journal tiddler.

image

But i have two reading list tiddlers with todays due-date

I guess i am making some mistake in the code.

Would you please share the value of due-date? I want to know how the date looks like in your due-date field.

Journal-date as I see from the image is a full date (TW format)

image

This is not correct! journal-date is not a macro! I am not sure if TiddlyTools has such a macro, if it has, then this may be correct!

Sorry that was not the code given by you. I accidentally changed it while I was checking what was going wrong.

I have edited it

Try this solution

!Reading list 
Filter and search in table <$edit-text tiddler="$:/temp/demo/dtable/search" filed=text tag=input default=""/> <$button set="$:/temp/demo/dtable/search" setTo="" tooltip="clear searchbox">x</$button>

<$vars journaldate={{{ [{!!journal-date}format:date[YYYY-0MM-0DD]] }}} >
<$macrocall $name=table-dynamic filter="""[tag[Readinglist]search{$:/temp/demo/dtable/search}] :filter[due-date<journaldate>]""" class="w-100 thead-dark float-right" fields="tbl-checkbox tbl-expand title priority status due-date location" pagination="yes" caption="''title''">>
</$vars>

This code shall be used in any journal tiddler which has a field journal-date with a full date value as shown in the image above.

I am sure you use a viewtemplate!

The trick is here: :filter[due-date<journaldate>]

Note that: `This code shall be used in any journal tiddler which has a field journal-date with a full date value as shown in the image above.

I am sure you use a viewtemplate!

Note that <$vars journaldate={{{ [{!!journal-date}format:date[YYYY-0MM-0DD]] }}} > reads the value of journal-date field and format it in such a way you can compare with due date from Shiraz dynamic table.

1 Like