Listing Journal Entries by Week

284 views
Skip to first unread message

stuar...@googlemail.com

unread,
Nov 6, 2020, 7:36:07 AM11/6/20
to TiddlyWiki
I am in the process of converting 18 months of previous journal log notes into a tiddlywiki.  I am interested in using the "new journal here" functionality as I like the way it can automatically tag the parent tiddler.  However, one of the problems I have is I need to summaries my log notes on a weekly basis.   I have set my default new journal title to:

YYYY: Week 0WW (YY/0MM/0DD at 0hh:0mm:0ss) - <<currentTiddler>>:

I am now looking for a way to sort these journal entries into an automatic list based on year and week number.  As I will be adding historic entries in the first instance I am unsure a method using creation date would be appropriate.

Anyone have any ideas? 

TW Tones

unread,
Nov 6, 2020, 5:25:55 PM11/6/20
to TiddlyWiki
Stuart,

It is wise not to use the journal title as the sort field since it is usually formatted for readability not sortability.

I have two modifications I use so new journal, and new Journal here actually adds a journal-date field. Then you can sort on that instead sort[journal-date], rather than using created if you want to say place an entry for a past date. I can show you how to create a data picker if you want.

If you use the days operator with -7 -14 etc... you may get what you want.

However Eric's recent package of date and timer tools could empower you a lot more http://tiddlytools.com/timer.html

Tones
journal-date.json

Charlie Veniot

unread,
Nov 7, 2020, 3:23:22 PM11/7/20
to TiddlyWiki
G'day Stuart, 

I throw this idea in here mostly for the $hit$ and the giggle$ interesting code.

I've been thinking, since reading your post ...

I loathe typing anything more than once, however small the effort, when it is something that can be otherwise transcluded/derived.

In my own TiddlyWiki journal entries related to ADHD Meds, the created tiddlers have names matching "YYYY-0MM-0DD"
  • If I wanted to add time, I'd follow up the date with a space and the time
  • If I wanted to adorn with anything else: add a space, then add that something else
My journal (an "aggregation" tiddler) hauls in (transcludes) all journal tiddlers into one nice big consolidated journal view and takes care of formatting everything in a way that makes the whole guacamole pretty to me.

If I wanted to instead show all the journal entries with "year and week" of each journal instead of dates, I would format those dates with this fancy gem:

<$view tiddler={{{ [all[current]split[ ]first[]split[-]join[]addsuffix[190213631]] }}} field="title" format="date" template="YYYY week WW"/>

Check out my "playtime experimentation" tiddler (screenshot further below for convenience).

Cheers !

Screenshot 2020-11-07 at 4.00.59 PM.png

Sapphireslinger

unread,
Nov 10, 2020, 8:06:10 AM11/10/20
to TiddlyWiki
@Tones

I would like to sort my tiddlers tagged [[Post Queue]] by week, so that I can see all the articles I've written in the past week and only choose the best one to blog.

I successfully installed your journal-date.json from this thread: https://groups.google.com/g/tiddlywiki/c/H-teh7Cv0kg/m/G6VT_k1wBgAJ?pli=1 (I assume it is the same you put in this thread here.) But I never did understand how to use it to sort by month or week.

How do I compile a list like the one below using the journal-date field that each of them has?

2020 week 44

(post in queue to be blogged)
(post in queue to be blogged)
(post in queue to be blogged)

2020 week 45

(post in queue to be blogged)
(post in queue to be blogged)
(post in queue to be blogged)

TW Tones

unread,
Nov 11, 2020, 4:42:55 PM11/11/20
to TiddlyWiki
Hi,

I will see if I can find a way to give you the full solution, but personally to achieve what you want I would look at the existing recent tiddlers tab which groups tiddlers by day and see if I could clone and modify it to achieve what you are after. However with Eric's powerful timer tools http://tiddlytools.com/timer.html it may be simpler to use his calendar approach.

However for any date you can obtain a week number https://tiddlywiki.com/#DateFormat 0WW eg 
<$view field=journal-date format=date template="0WW"/>
<
<now "0WW">>

In the pre-release there may be a way to sort by the "derived week number" using sortsub

Other approaches may be to use the range operator and days operator asking for days ago eg -7 to 0,  -14 - 8 etc, you will need a macro to pass numbers into the range and days operator as $n$.

Of course something to consider is grouping by week is still only in reverse chronological order, so if you display a heading every time the week number changes you will also get what you are after.

I will return if I find an easy to share solution.

Tones

Sapphireslinger

unread,
Nov 15, 2020, 6:15:43 AM11/15/20
to TiddlyWiki
I tried what you suggested. I came to the conclusion that I should wait and see if you come up with anything. ^o^

If curious, here is what I did (that didn't work at all):

I found $:/core/ui/SideBar/Recent (tagged with $:/tags/SideBar) containing:

<$macrocall $name="timeline" format={{$:/language/RecentChanges/DateFormat}}/>

I found $:/core/ui/MoreSideBar/Recent (tagged with $:/tags/MoreSideBar) containing:

<$macrocall $name="timeline" format={{$:/language/RecentChanges/DateFormat}}/> $:/core/macros/timeline (tagged with $:/tags/Macro) contains \define timeline-title() \whitespace trim <!-- Override this macro with a global macro of the same name if you need to change how titles are displayed on the timeline --> <$view field="title"/> \end \define timeline(limit:"100",format:"DDth MMM YYYY",subfilter:"",dateField:"modified") <div class="tc-timeline"> <$list filter="[!is[system]$subfilter$has[$dateField$]!sort[$dateField$]limit[$limit$]eachday[$dateField$]]"> <div class="tc-menu-list-item"> <$view field="$dateField$" format="date" template="$format$"/> <$list filter="[sameday:$dateField${!!$dateField$}!is[system]$subfilter$!sort[$dateField$]]"> <div class="tc-menu-list-subitem"> <$link to={{!!title}}><<timeline-title>></$link> </div> </$list> </div> </$list> </div> \end

So I created a clone like this:

$:/core/ui/SideBar/Post-Queue (tagged with $:/tags/SideBar) containing:

<$macrocall $name="timeline-2" format={{$:/language/RecentChanges/DateFormat}}/>

and a clone like this $:/core/ui/MoreSideBar/Post-Queue (tagged with $:/tags/MoreSideBar) containing:

<$macrocall $name="timeline-2" format={{$:/language/RecentChanges/DateFormat}}/>

And a clone like this: $:/core/macros/timeline-2 (tagged with $:/tags/Macro) containing:

\define timeline-title() \whitespace trim <!-- Override this macro with a global macro of the same name if you need to change how titles are displayed on the timeline --> <$view field="title"/> \end \define timeline(limit:"100",format:"DDth MMM YYYY",subfilter:"",dateField:"modified") <div class="tc-timeline"> <$list filter="[!is[system]$subfilter$has[$dateField$]!sort[$dateField$]limit[$limit$]eachday[$dateField$]]"> <div class="tc-menu-list-item"> <$view field="journal-date" format="date" template="0WW"/> <<now "0WW">> <$list filter="[sameday:$dateField${!!$dateField$}!is[system]$subfilter$!sort[$dateField$]]"> <div class="tc-menu-list-subitem"> <$link to={{!!title}}><<timeline-title>></$link> </div> </$list> </div> </$list> </div> \end
Reply all
Reply to author
Forward
0 new messages