I have created a button that allows me to create a subtiddler for the current tiddler, and can be additionally customised by adding fields to a tiddler. On one tiddler I have added a field so that the created subtiddler is created with the current date, like this: MyTiddler/2022-01-10
. This is similar to the code for the new journal button.
However, it will often show the wrong date and require a refresh to show the correct one. For example when I clicked the button today it used yesterday’s date. I then clicked the new journal button and it used the correct date, so I am assuming it is a problem with how I’ve implemented the button, but I’m not sure what the issue is.
Subtiddler button code
This is the button I created: $ _ibby_ui_new-note-button.json (1.1 KB) I’ve also copied the code below.
\whitespace trim
<$wikify name="noteTitle" text="""<$macrocall $name="now" format={{{ [all[current]get[note-title]else[ ]] }}}/>""">
<$let currentPrefix={{{ [<storyTiddler>addsuffix[/]addsuffix<noteTitle>] }}} >
<$button
tooltip="Create new subtiddler note"
aria-label="New note"
class=<<tv-config-toolbar-class>> >
<$action-sendmessage
$message="tm-new-tiddler"
title=<<currentPrefix>>
tags={{{ [all[current]get[note-tags]else[Note]] }}} />
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/ibby/images/forward-slash}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">New note</span>
</$list>
</$button>
</$let>
</$wikify>
Fields used
On the tiddler where I’m experiencing this issue, I used the following fields:
note-tags: Note Journal
note-title: YYYY-0MM-0DD