How to generate list of tiddlers created on date provided in title of tiddler?

96 views
Skip to first unread message

jay

unread,
Apr 25, 2019, 12:42:28 PM4/25/19
to TiddlyWiki
So I've been keeping a tiddlywiki journal for a while, and I divide my posts into various categories: short lifelogs, notes, diary entries, etc.

I'd like to have a calendar with dates that I can click on to see all tiddlers created on that day.

I'm figuring my best bet is to use this http://simplecalendar.tiddlyspot.com/ plugin. It creates a new tiddler for each day, perfect. Now, I want to set up a template that I can use for each 'day' tiddler. This template will include a list of, say, all my lifelog posts from that day. How can I tell the list filter that I want to show posts from the correct day, IE the one in the title of the tiddler generated by this plugin?

Does this make sense?  My only experience of coding is using tiddlywiki so go easy on me.

Mark S.

unread,
Apr 25, 2019, 2:23:21 PM4/25/19
to TiddlyWiki
Do your lifelog posts include links to the day they were made, possibly as a timestamp? That would be the easiest way to set it up. Then you could just use the backlinks operator to find all the log entries that referred to a certain day.

Method 2

There is no easy way to convert a title back into a date. But if the tiddler really was made on the same day as it's title, then it's "created" field will contain the timestamp of when it was created. And if the blogs were made on the same day, then perhaps your filter could contain a sameday:created{!!created}} operator .

Actually, yeah, method 2 should work as long as you don't create post-date tiddlers or life-log tiddlers.

Good luck
-- Mark
Message has been deleted

jay

unread,
Apr 25, 2019, 7:05:46 PM4/25/19
to TiddlyWiki
Hey, thanks for replying! I must say this app has kind of changed my life, and I'm really enjoying learning from this community.

The title of my lifelog tiddlers begins with the date and time they're created, and the 'created' field mirrors that. They're also all tagged 'lifelog'.

For each 'day' in the wiki I have a tiddler generated by the simplecalendar plugin. The title of that tiddler matches the date on the lifelogs, but it's created field wont. This is the code I currently have in that 'day' tiddler template

<$list filter="[sameday:created[20190424]]+[tag[lifelog]] +[sort[created]] ">
<$link>
<$view field="created" format="date" template="DD mmm YY at hh:mm"/></$link>
 <$transclude field="text" mode="block"/>

</$list>

This shows me exactly what I need, and I can easily replicate this with other tags to create a nice synopsis of what I did on that day.  But how can I get the date in bold to match up with the date in the title of the tiddler (the title is formatted 2019-04-24)? I'd rather not have to type this in for every day individually.

Thanks again Mark!

Mark S.

unread,
Apr 25, 2019, 8:18:19 PM4/25/19
to TiddlyWiki
The tools to do what you want don't exist in the current vsn of TW, but do in the next prerelease (5.1.20pre). So if you're willing to be an early adopter then you can have something like this:

<$vars mystring={{!!title}} splitter="-">
<$list filter="[<mystring>split[-]join[]addsuffix[120000000]]" variable=thisdate>
<<thisdate>>
<$list filter="[sameday:created<thisdate>]">

</$list>
</$list>
</$vars>

This depends on the title being exactly as you described (yyyy-mm-dd).

You may have to play with the 120000000 to match your timezone. The plain "yyyymmdd" has never worked as advertised in the docs for "sameday" for me. It's always needed something after the "dd" to work right.

Good luck!
-- Mark

TonyM

unread,
Apr 25, 2019, 9:37:10 PM4/25/19
to TiddlyWiki
jay,

I am about to build a tiddlywiki for "

Mobile Journal , health and Exercise log/routine"



I plan to allow new Journals for today or an arbitrary date. I will however retain created date to mean exactly what it means. I will build my own new journal entry to have whatever title I want, yet have a journal-date stamp field which can be generated on today or selected using pickaday plugin. I will use a tiddler tagged view template to provide additional information on any tiddler with the journal date such as the long date, relative date and day of week.

I also intend to build exercise items for the date and week that a button click will indicate the sets and repetition done for that exercises on a give journal tiddler (in its fields).

I will see if I can share this once done.

Regards
Tony 

jay

unread,
Apr 27, 2019, 4:23:03 PM4/27/19
to TiddlyWiki
This solved my problem! Brilliant! I am very grateful.

Could I use similar code to make a button that will create a new tiddler with the title format '<thisdate> todolist'? I've tried with no success...

Mark S.

unread,
Apr 27, 2019, 4:38:38 PM4/27/19
to TiddlyWiki
If you're not already using the journal button, then you could just use it.

Go into the control panel, basic information and where it asks for the title of new journal tiddlers, put

YYYY-0MM-0DD todolist

You can also go over to the sidebar, click on the "tools" tab, and check the box next to "new journal". Now a journal button will be available at the top of the sidebar, Click on it to start a new tiddler with your current date stamp.

HTH
-- Mark
Reply all
Reply to author
Forward
0 new messages