How to list all tiddlers created on a particular day in that days Journal tiddler

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

As long as your journal was actually created on the same day as its title, then this should work:

<$list filter="[!is[system]sameday{!!created}] [!is[system]sameday:created{!!created}] +[unique[]]">

</$list>
1 Like

Give this a try…

Create a tiddler (e.g., “MyJournalTemplate”), tagged with $:/tags/ViewTemplate, containing:

<$list filter="[<currentTiddler>tag[Journal]]">
   <$set name="created" filter="[!is[system]!has[draft.of]sameday:created{!!created}]">
   <$set name="modified" filter="[!is[system]!has[draft.of]sameday{!!created}!enlist<created>]">
   created:<<list-links filter:"[enlist<created>]">>
   modified:<<list-links filter:"[enlist<modified>]">>
   </$set>
   </$set>
</$list>

Notes:

  1. 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”.

  2. <$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.

  3. 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.

  4. The next two lines output the “created” and “modified” headings and corresponding lists using a bullet format.

3 Likes

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

Is it possible to list the tiddlers based on the journal title (which is that day’s date) instead of created date of the Journal tiddler.

Or can the filter be modified to use the journal-date field as created by this journal template by @TW_Tones

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?

-e

1 Like

It’s easy to change the matching field from created to journal-date… just change the !!created reference in these two line:

<$set name="created" filter="[!is[system]!has[draft.of]sameday:created{!!created}]">
<$set name="modified" filter="[!is[system]!has[draft.of]sameday{!!created}!enlist<created>]">

to use !!journal-date

<$set name="created" filter="[!is[system]!has[draft.of]sameday:created{!!journal-date}]">
<$set name="modified" filter="[!is[system]!has[draft.of]sameday{!!journal-date}!enlist<created>]">

-e

@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.

-e

1 Like

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.

Fortunately, I already have a macro that can do the conversion:
https://TiddlyTools.com/timer.html#TiddlyTools%2FTime%2FConvertDate
and I’ve just posted an update to https://TiddlylTools.com/timer.html that adds a new component:

To install:

  1. Copy TiddlyTools/Time/ConvertDate and TiddlyTools/Time/JournalListChanges into your TiddlyWiki.
  2. Save-and-reload (so TiddlyTools/Time/ConvertDate – a javascript macro – can take effect)
  3. Create and view a Journal tiddler. You should see “created” and “modified” lists displayed.

Let me know if you have any problems.

enjoy,
-e

1 Like

Should i use TW_Tones journal template solution also or just the Convert date and JournalListChanges

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.

-e

1 Like

When used with Calendar, it works perfectly. Thank you.

I have some doubts regarding the styling of calendar which i have asked in this thread

@EricShulman I started to redo the journal-date mods to new and new here Journal buttons.

  • This includes;
    • Use the latest version of the related core tiddlers
    • Create two alternate buttons rather than overwrite core buttons
    • a default fieldname of journal-date which can be changed as needed.
    • Provide an embedded datepicker so the date can be pre/or post dated if needed
  • In my designs I use the suffix “-date” to detect date fields.

However I am currently seeking and income which may delay me.

Hi @EricShulman can you make your tiddlywiki tools plugins, so install update is easier?