How to list all tiddlers created or modified on a particular day in that day’s Journal tiddler automatically . I plan to insert that code in the Text for new journal tiddlers in the Info tab control panel.
Its like a Recent tiddler but showing only that particular days tiddlers.
Calendar by Eric Shulman does this. But how to extract that filter or code to use it in Journal tiddler
By tagging the tiddler with $:/tags/ViewTemplate, the code will automatically be processed for every tiddler without needing to insert it into each individual Journal tiddler. The first line (<$list>) ensures that the content that follows is only displayed when the tiddler is actually tagged with “Journal”.
<$set name="created" ...> gets a list of all non-system , non-draft tiddlers whose created date is the same as the created date of the Journal tiddler.
Similarly, <$set name="modified" ...> gets a list of all non-system, non-draft tiddlers whose modified date is the same as the created date of the Journal tiddler. Note that it also excludes any tiddlers that were already identified by the previous filter, so that those tiddlers won’t be listed twice.
The next two lines output the “created” and “modified” headings and corresponding lists using a bullet format.
Thanks @EricShulman and @Mark_S for your help and suggestion. Both solutions works. Eric’s solution has an extra benefit of sorting tiddlers which are created vs modified on that day separately
Tony’s “journal template” solution is slightly out-of-date with the current TWCore implementation for $:/core/ui/Actions/new-journal and $:/core/ui/Actions/new-journal-here actions.
Specificially, the TWCore versions now use textFieldTags (contents of $:/config/NewJournal/Tags) as well as continuing to support the backwards-compatible use of tagsFieldTags (contents of $:/config/NewJournal/Tags!!tags.
However, the $:/ControlPanel setting for “Tags for new journal tiddlers” only sets the text field in $:/config/NewJournal/Tags. As a consequence, if you are using a newer TWCore, there is no value stored in $:/config/NewJournal/Tags!!tags.
The problem is that Tony’s journal actions don’t apply the tag that is stored in the $:/config/NewJournal/Tags text field, leaving the resulting journal tiddler without any tag set.
Also note that Tony’s solution saves the date stamp in a field named journal-date, while my TiddlyTools Calendar, which has a similarly enhanced journal creation handler uses a field named journaldate (without the hyphen). We should coordinate both methods to use the same field name. Obviously, I prefer using the field name without the hyphen.
Another minor difference: the value Tony saves in the journal-date field uses a date format of YYYY0MM0DD0hh0mm0ss000 (i.e., milliseconds is hard coded to “000”), while my TiddlyTools Calendar code uses YYYY0MM0DD0hh0mm0ss0XXX (i.e., milliseconds is included as a zero-padded value).
@TW_Tones … could you please consider updating your “journal template” actions accordingly so that they match the TiddlyTools Calendar implementation?
@TW_Tones … after some more thought, for compatibility with your existing “journal template” solution, I’ve decided to change TiddlyTools Calendar to use your field name (i.e., journal-date, with the hyphen). This eliminates a significant difference between our two implementations and will preserve backward-compatibility with any existing journal tiddlers you’ve already created with that field name.
Of course, you should still update your implementation for compatibility with the TWCore’s newer handling for textFieldTags vs. tagsFieldTags, and I would also encourage you to make the minor adjustment to the format for the journal-date field value (i.e., to include zero-padded milliseconds in the timestamp), as I’ve outlined in my previous post.
This is a bit tricky, since the “journal title” might not contain a date at all, and can actually be any text (e.g., “MyJournal”). Even if it is a date-formatted string… we still need to convert the title text to a TWCore standard 17-digit “timestamp” value so we can use it to find the changed tiddlers by matching with the created and modified fields of those tiddlers.
If you use the TiddlyTools Calendar “edit journal” button (in the popup for each calendar date), it now automatically adds a journal-date field to the resulting Journal tiddler. @TW_Tones’ solution provides modified versions of the “New Journal” and “New Journal here” button actions in order to do the same thing for those individual toolbar and sidebar buttons, so it is a good idea to add his solution to the mix.
Note that Tony still needs to update his code to be in sync with the current TWCore $:/ControlPanel handling that now uses the text field instead of the tags field in $:/config/NewJournal/Tags.