Journal Timestamp way off

171 views
Skip to first unread message

Skeeve Magick

unread,
Aug 3, 2020, 9:34:07 AM8/3/20
to TiddlyWiki
Is this intended behaviour?

Tiddler "ToDo" contains

<$list filter="[all[current]tagging[]]">
{{||$:/tagged/journal}} <$link /> (Letzter Eintrag: <$list filter="[all[current]tagging[]!sort[created]limit[1]]" />)
<br />
</$list>

The Journal tiddler new title is defined to be "YYYY-0MM-0DD 0hh:0mm:0ss"

I opened this tiddler once in the morning. A few hours later I clicked the edit-button and the new tiddler which opens has the timestamp of the time I opened the ToDo tiddler. Not the current time.

Is this intended behaviour?

TiddlyWiki Version is 5.1.22


Skeeve Magick

unread,
Aug 5, 2020, 1:09:32 AM8/5/20
to TiddlyWiki
So it seems it's, if not normal, not noticed by anyone yet.

PMario

unread,
Aug 5, 2020, 3:57:41 AM8/5/20
to TiddlyWiki
Hi,
I did test it with tiddlywiki.com and it works there.
So what did you change in your wiki?
-m

Skeeve Magick

unread,
Aug 5, 2020, 4:13:42 AM8/5/20
to TiddlyWiki
Nothing, mario. It was a plain vanilla download 2 weeks ago. No plugin or whatever.

Skeeve Magick

unread,
Aug 5, 2020, 4:20:50 AM8/5/20
to TiddlyWiki
Example: I clicked the "Pen" left to "IP-Freigabe" a few minutes ago. The Tiddler was opened yesterday morning. You see: The new tiddler's date and time is from yesterday morning.
Bildschirmfoto 2020-08-05 um 10.15.15.png

TW Tones

unread,
Aug 5, 2020, 4:31:38 AM8/5/20
to TiddlyWiki
Skeeve,

I read that again and yes I think it us normal. 

If you have time in your journal title, it opens the new journal tiddler in the morning as a draft tiddler. You do not have to edit or save it it just sits there as draft tiddler with the time it was clicked forming the title. If you subsequently save this it becomes a tiddler with the time/title the tiddler was when it became a draft tiddler. Unless you change the title.

Basically you left it a long time between click to create and save. 

If you look closely, if you leave a new tiddler in edit mode it is actually opened with a draft of title.

If it happens again just click to delete/or close the unwanted "missing tiddler" and click new journal again.

Regards
Tony

TW Tones

unread,
Aug 5, 2020, 4:33:47 AM8/5/20
to TiddlyWiki
Post script

I use a title of "YYYY-0MM-0DD" and type my journal into this tiddler, if a click again on the same day I open the same tiddler and add more at the bottom.

If you choose to have a journal down to the second, I suggest you edit and save right away.

Regards
Tony


On Monday, August 3, 2020 at 11:34:07 PM UTC+10, Skeeve Magick wrote:

Skeeve Magick

unread,
Aug 5, 2020, 9:42:22 AM8/5/20
to TiddlyWiki
Sorry Tony. IO think I didn't make it clear.

I opened the "ToDo" tiddler yesterday.

Only today I clicked the "Pen" at "IP-Freigaben" whiche opened a draft tiddler with yesterday's date.

BTW: I do not need the time down to the second, But as it COULD happen that I create 2 tiddlers in the same minute, it is useful to have it down to the second. Just imagine I make my notes for today for the "IP-Freigaben" at 08:00:00 and my notes for "Sonstiges" at 08:00:59… Without the second this wouldn't work as I would get the same title for both tiddlers.

Skeeve Magick

unread,
Aug 5, 2020, 10:37:38 AM8/5/20
to TiddlyWiki
After some investigation it seems that's the way it is.

When you open the drop down on a tiddler's title to get to the "New Journal Here" entry and simply keep it open for quite some time before you click it, you get the timestamp of the time you opened the dropdown.

PMario

unread,
Aug 5, 2020, 3:33:09 PM8/5/20
to TiddlyWiki
Hi,

Can you also show the code from the $:/tagged/journal tiddler. it is used as a template. There probably is a problem with button actions and the <<new macro in the button body, which is wrong.

Your Pen-icon is edit. ... So it's clear, that it opens an existing tiddler and doesn't crate a new one.

-m

PMario

unread,
Aug 5, 2020, 3:34:31 PM8/5/20
to TiddlyWiki
Hi,
I'm pretty sure I know where the problem comes from. The template code would be important to solve it.
-m

Eric Shulman

unread,
Aug 5, 2020, 10:38:40 PM8/5/20
to tiddl...@googlegroups.com
On Monday, August 3, 2020 at 6:34:07 AM UTC-7, Skeeve Magick wrote:
Tiddler "ToDo" contains
<$list filter="[all[current]tagging[]]">
{{||$:/tagged/journal}} <$link /> (Letzter Eintrag: <$list filter="[all[current]tagging[]!sort[created]limit[1]]" />)
<br />
</$list>
The Journal tiddler new title is defined to be "YYYY-0MM-0DD 0hh:0mm:0ss"
I opened this tiddler once in the morning. A few hours later I clicked the edit-button and the new tiddler which opens has the timestamp of the time I opened the ToDo tiddler. Not the current time.
 
Although you didn't show the contents of $:/tagged/journal, I assume it contains a $button that sends a "tm-new-tiddler" message to create a new journal tiddler.

If this is the case, then I suspect the problem is due to a subtle yet important aspect of the $button definition.

If you define a button using "inline" actions, like this:
<$button>
  label
  <$action-sendmessage message="tm-new-tiddler" etc... />
</$button>
then the button's action(s) are parsed when the button is rendered.   Thus, if the action(s) calculate the new title based on the current time (i.e., using the <<now>> macro), then that new title will use the time that the button is rendered.

However, there is a different way to invoke a button's action(s), using the actions="""...""" parameter, like this:
<$button actions="""<$action-sendmessage message="tm-new-tiddler" etc... />""">
   label
</$button>

or like this:
\define myActions()
<$action-sendmessage message="tm-new-tiddler" etc... />
\end

<$button actions=<<myActions>>
   label
</$button>

In this case, the button's actions are parsed when the button is actually pressed.  Thus, any use of the <<now>> macro will correctly reflect the time when the button is pressed, not when it was rendered.

Note that the TWCore's NewJournal button ($:/core/ui/Buttons/new-journal) uses the actions="..." method, while the NewJournalHere button ($:/core/ui/Buttons/new-journal-here) uses the "inline" actions method.  Thus, NewJournal uses the correct "time of button press" timestamp, while the NewJournalHere button uses the incorrect "time of button rendering" timestamp.

Hopefully, the above info will help you fix your button...

Let me know how it goes.

-e


TW Tones

unread,
Aug 6, 2020, 1:03:33 AM8/6/20
to TiddlyWiki
Eric,

Thanks so much for explaining this. I have long missed this point. It is nice to know because one can possibly make use of this difference.

I wonder if this could be used to capture some values and restore them if needed?

That make me think, why does the edit button not make a copy of the tiddler so we can restore its previous value if needed?

That will be an easy button to make :)

Regards
Tony

Skeeve Magick

unread,
Aug 6, 2020, 2:16:56 AM8/6/20
to TiddlyWiki
Hi Eric and also Mario.

I'm stupid! Of course the $:/tagged/journal tiddler was copy&pasted by me.

This is its content:

\whitespace trim
\define journalButtonTags()
[[$(currentTiddlerTag)$]] $(journalTags)$
\end
\define journalButton()
<$button tooltip={{$:/language/Buttons/NewJournalHere/Hint}} aria-label={{$:/language/Buttons/NewJournalHere/Caption}} class=<<tv-config-toolbar-class>>>
<$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>""">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalButtonTags>>/>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/
core/images/edit-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text={{$:/
language/Buttons/NewJournalHere/Caption}}/>
</span>
</
$list>
</$wikify>
</
$button>
\end
<$set name="journalTitleTemplate" value={{$:/config/NewJournal/Title}}>
<$set name="journalTags" value={{$:/config/NewJournal/Tags!!tags}}>
<$set name="currentTiddlerTag" value=<<currentTiddler>>>
<<journalButton>>
</$set>
</
$set>
</$set>

It's a copy of the $:/core/ui/Buttons/new-journal-here with the image exchanged.

Thanks to Eric it's now working with this content:

\whitespace trim
\define journalButtonTags()
[[$(currentTiddlerTag)$]] $(journalTags)$
\end
\define btnactn()
<$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>""">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalButtonTags>>/>
</
$wikify>
\end
\define tooltip() "Create a tiidler tagged »$(currentTiddlerTag)$«"
\define journalButton()
<$button actions=<<btnactn>> class=<<tv-config-toolbar-class>> tooltip=<<tooltip>>>
{{$:/core/images/edit-button}}
</$button>
\end
<$set name="journalTitleTemplate" value={{$:/
config/NewJournal/Title}}>
<$set name="journalTags" value={{$:/config/NewJournal/Tags!!tags}}>
<$set name="currentTiddlerTag" value=<<currentTiddler>>>
<<journalButton>>
</$set>
</
$set>
</$set>



Reply all
Reply to author
Forward
0 new messages