Todays view in Mod of the Sticky-ToDo-Plugin

https://szen.io/ToDo/
This is the Mod of the Sticky-ToDo-Plugin by JanJo.

He is using these macros to list the todos sorted by dates.

\define ToDo-date() [<currentTiddler>search-replace::regexp[.*<<ToDo ".+?" ".*?" "(.*?)">>.*],[$1]!match[]else[zzz]]

\define ToDo-sidebar-date()
<$list filter="[regexp:text<ToDo-string>!is[system]!is[current]first[1]]" emptyMessage={{$:/plugins/JJ/ToDo/settings##done-message}} variable="x">
  <<ToDo-search>>
  <$wikify name="ToDo-filter-result" text=<<ToDo-filter>>>
  <$list filter="[regexp:text<ToDo-string>!is[system]!is[current]subfilter<ToDo-filter-result>get[text]join[spl1t]]" variable="longstring">
    <$list filter="[<longstring>splitregexp[\n|spl1t]regexp<ToDo-string>sortsub<ToDo-date>]" variable="line">
      <div style="margin-left:2em;text-indent:-1em;" title=<<line>> > {{{ [<line>search-replace::regexp[.*<<ToDo ".+?" ".*?" "(.*)">>.*],[$1]] }}}
        <$list filter="[search<line>]">
        <$list filter="[<line>search-replace::regexp{$:/plugins/JJ/ToDo/settings##sidebar-search},[$1]]" variable="line-clean"><<line-clean>></$list>
 </$list>
      </div>
    </$list>
    <br>
  </$list>
  </$wikify>
</$list>
\end

I tried to modify it and created a new macro to list the todos for today only using this tip from JanJo.

\define ToDo-now() [<currentTiddler>search-replace::regexp[.*<<ToDo ".+?" ".*?" "(.*?)">>.*],[$1]match<now>]

\define ToDo-sidebar-now()
<$list filter="[regexp:text<ToDo-string>!is[system]!is[current]first[1]]" emptyMessage={{$:/plugins/JJ/ToDo/settings##done-message}} variable="x">
  <<ToDo-search>>
  <$wikify name="ToDo-filter-result" text=<<ToDo-filter>>>
  <$list filter="[regexp:text<ToDo-string>!is[system]!is[current]subfilter<ToDo-filter-result>get[text]join[spl1t]]" variable="longstring">
    <$list filter="[<longstring>splitregexp[\n|spl1t]regexp<ToDo-string>sortsub<ToDo-now>]" variable="line">
      <div style="margin-left:2em;text-indent:-1em;" title=<<line>> > {{{ [<line>search-replace::regexp[.*<<ToDo ".+?" ".*?" "(.*?)">>.*],[$1]] }}}
        <$list filter="[search<line>]">
        <$list filter="[<line>search-replace::regexp{$:/plugins/JJ/ToDo/settings##sidebar-search},[$1]]" variable="line-clean"><<line-clean>></$list>
 </$list>
      </div>
    </$list>
    <br>
  </$list>
  </$wikify>
</$list>
\end

But this is listing all the todos like the previous macro does. Can someone help to correct it ?

I think this question of yours is being neglected because it is too much information and asks too much of someone wanting to help you. It in some ways asks a respondent to want and do exactly as you have just to see what is the problem. We have to get the plugin and read the mod and you have not even explained what outcome you want.

I respectfully suggest you try and apply some troubleshooting steps of our own and see if you can reduce this to a simpler question.

Only thing needed is to change the filter to get the todos assigned for today…I don’t know much about regexp, so I am unable to crack this. If I get time, I will put up a demo of what I tried.

Just a guess: the filter defined in ToDo-now() ends with <now> which produces a string looking like this: 00:56, 27th July 2022 (depending on your locale).
This string will never match any todo item date, because they are formatted like this: 2022-07-26, so I think you should add a format string to the macro.

Fred

2 Likes

Regexp are not necessarily the answer. Typically we could have todos with a tiddlywiki serial date assigned to them then we can compare the first 6 characters with those in a now date.

<now YYYY0MM0DD> today in a filter
[get[do-date]split[]first[6]]a tiddlywiki serial date reduced to just a day

[all[current]get[do-date]split[]first[6]join[]match<now YYYY0MM0DD>] to test the current tiddler

You could also use the days operator etc…

Edited as Per @EricShulman

1 Like

I think you need a join[] before the match, like this:

[all[current]get[do-date]split[]first[6]join[]match<now YYYY0MM0DD>]
3 Likes

Hi @arunnbabu81 ,
Now I am back from my vacation.
Is your question solved (as I would expect if there is an answer by Eric ;-).
Is there a result I should make accessible for others?

1 Like

Hi @JanJo

I didn’t get time to test it. I am also confused about which filter in the macro to be replaced. It would be better if you could post the code for today macro in the plug in site or here in the forum

Well, finally I managed to do it, here’s a .json of the two tiddlers, a macro and a viewTemplate: tiddlers(10).json (1.1 KB)

It requires the journal-date field to work and shows all the ToDos for Today (resp. that Day). Cheers!

Perhaps you could also link what you made of it, @arunnbabu81

This is how my Journal tiddler looks like (It has a journal-date field). Using a viewtemplate, I extract all relevant data for that particular data. In that, the ToDay view of Sticky ToDo is also a part.

Here is the demo - Click on the Journals link in the topbar

1 Like

Hi journalists,
I made a slightly more versatile version of the macro and the template where you can enter the date more easy. tiddlers(11).json (1.1 KB)

For example you can use it show the Todos of the current date.

BTW: Is there a smart way to use the now macro (or something else) to show the day after to today… and two days after today…

  • The only native way is via the days operator

One trick is to have one days operator following another to get a range of dates.

1 Like