Journal note : get the list of created tiddlers on that date

Hello,

I was quite sure I would be able to find it on the googlegroups or somewehre else but I did not (maybe wrong search)

I am creating a template for the journal tiddler and I would like to get the list of tiddlers created on the tiddler date (two options, depending of what is feasible : creation date of the journal date or title containing the date)

Thank you

1 Like

Hello,

This snippet will create a list of links to the non-system tiddlers created the same day.

<<list-links filter:"[sameday:created{!!created}!is[system]]">>

Let’s unpack the magic of the filter:

  • sameday will look for tiddlers whose updated date matches what you select, someday:created uses the created field instead
  • {!!created} points to the created date of the current tiddler
  • !is[system] excludes tiddlywiki internals

Feel free to add something like tag[JournalEntry] if you want to limit it to things tagged with JournalEntry.

Regards

Nice!

What about “on this day” — in previous years?

With 5.2.0 I believe you could do this:

<$vars day={{{[<now 0MM0DD>]}}}>

<$list filter="[all[tiddlers]] :filter[{!!created}else[]format:date[0MM0DD]match<day>]">

</$list>

</$vars>

The tricky part to get right is time zones.

Works like a charm ! Thanks

1 Like

Never before I used the :filter, thanks for the insight @saqimtiaz. However I did not manage to make that work without changes:

<$vars day={{{ [all[current]get[created]format:date[0MM0DD]] }}}>
<<list-links filter:"[all[tiddlers]!is[system]!sort[created]] :filter[get[created]else[]format:date[0MM0DD]compare:string:eq<day>]">>
</$vars>

Yep, the code I posted was working off of today’s date (and needs TW 5.2.0 pre-release) rather than taking that date from a tiddler. Glad you were able to adapt it to your use case.

Just for comparison purposes, here’s a version that is backward-compatible with older versions of TiddlyWiki, and illustrates how much TiddlyWiki syntax has become more advanced:

<$set name="day" filter="[<currentTiddler>get[created]split[]rest[4]first[4]join[]]">
<ul>
<$list filter="[all[tiddlers]!is[system]!sort[created]]">
   <$list filter="[<currentTiddler>get[created]split[]rest[4]first[4]join[]match<day>]" variable="match_day">
      <li><$link/></li>
   </$list>
</$list>
</ul>
</$set>

Notes:

  1. Replaced "filtered transclusion:
    <$vars day={{{ [...] }}}> → <$set name="day" filter="[...]">
  2. Replaced “format:date” filter operator:
    format:date:[0MM0DD] → split[]rest[4]first[4]join[]
  3. Replaced “:filter” filter run:
    :filter[...] → nested <$list filter="..."> widgets
  4. Replaced “compare…” filter operator:
    compare:string:eq<day> → match<day>
  5. Replaced “list-links” macro:
    <<list-links ...>> → HTML <ul>...</ul> and <li>...</li>, and <$link/> widget

-e

Absolutely! While the filter syntax is quite tricky to master it is incredibly powerful. Some times I’m really astonished what our users do with it.

I would also suggest the use of an independent journal-date, rather than the created date, this allows you to backdate journal entries without loosing knowledge of when the tiddler was actually created. If also lets you to choose what ever title your want, and rename them without loosing access to journals from that date.

To achieve this I created two modified New Journal, and New Journal here buttons. Ask if you want them.

Hi,

I also thought about this ; could you please help me on that topic ?

Thanks

I will share the button I have but need to find out if and how we can attach files here (other than images)

Try this.

journal-date.json (2.9 KB)

Hi,

I have imported your file in my tiddly but I do not see any difference ; did I miss something ? Should I do an additional config ?

Thanks

Now create a new journal entry from the page control buttons or new Journal here. Inside you will see there is now a journal-date field.

If you need to modify the journal date you could use http://kixam.github.io/TW5-datePicker/

Whoops, I did not see that ! Thank you very much !

Hi,

it seems that when I click on the new journal button, it does not apply the tag I defined by default in the settings for the journal tiddler, it is empty ;

what should I do in order to enable that ?

Thanks

My journal tiddlers were built on an earlier version of tiddlywiki. Today I will rebuild them for 5.1.23 and test it on the prerelease 5.2.0 and post back.

Co-incidentally I was working with @pmario on this issue of editing tiddlers updated in core updates.

Here is an updated package tested on TiddlyWiki 5.1.23 and the current 5.2.0 pre-release which now honors preset tags, content and title.

journal-date.json (2.9 KB)

1 Like

Great ! Thanks ! It works like a charm, I really appreciate your help !