The “New journal here” button is defined here:
https://tiddlywiki.com/#%24%3A%2Fcore%2Fui%2FButtons%2Fnew-journal-here
If you examine that tiddler, you will find that the button actions are defined “inline” inside the $button
definition using these three lines:
<$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>""">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalButtonTags>>/>
...
</$wikify>
The problem arises because the above code calculates the journalTitle
value (using the now
macro) when the button is first rendered, rather than when the button is actually clicked upon.
You can correct this by moving these three lines from the journalButton()
definition into a separate macro definition, like this:
\define newJournalHereActions()
<$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>""">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalButtonTags>>/>
</$wikify>
\end
and then, in the journalButton()
macro definition, add an actions=...
parameter to the $button
definition to invoke <<newJournalHereActions>>
, like this:
<$button tooltip={{$:/language/Buttons/NewJournalHere/Hint}}
aria-label={{$:/language/Buttons/NewJournalHere/Caption}}
class=<<tv-config-toolbar-class>>
actions=<<newJournalHereActions>>>
The result is that the $wikify
widget that computes the target journal title value will be performed when the $button
is pressed, rather than when the $button
is initially rendered, thus producing a unique datetime value each time.
This should probably be reported on GitHub as a bug to be fixed.
enjoy,
-e