date format

130 views
Skip to first unread message

Peter Buyze

unread,
Apr 22, 2020, 8:40:46 AM4/22/20
to TiddlyWiki forum
In the Info section of a tiddler there is, among other info, the created date.
The format is yyyymmddhhss+4 more digits. I don't want those last 4 digits. How can I change this setting?


--
Securely sent with Tutanota. Get your own encrypted, ad-free mailbox:

Eric Shulman

unread,
Apr 22, 2020, 9:13:06 AM4/22/20
to TiddlyWiki
On Wednesday, April 22, 2020 at 5:40:46 AM UTC-7, Peter Buyze wrote:
In the Info section of a tiddler there is, among other info, the created date.
The format is yyyymmddhhss+4 more digits. I don't want those last 4 digits. How can I change this setting?

Actually, the format is YYYY0MM0DD0hh0mm0ss0XXX

Thus: Year (4), Month (2), Day (2), Hours (2), Minutes (2), Seconds (2), Milliseconds (3)


My question to you: why don't you want the last digits?

-e


Peter Buyze

unread,
Apr 22, 2020, 9:18:58 AM4/22/20
to TiddlyWiki forum
Eric, I don't want those last digits because they add absolutely nothing, and they only make reading the date, which lacks dashes, more difficult. I would also like to add dashes.

Thanks for providing the link. How can I get into the ViewWidget, and in there is it just a matter of amending the format?


22 Apr 2020, 16:13 by elsd...@gmail.com:
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

Birthe C

unread,
Apr 22, 2020, 9:46:00 AM4/22/20
to TiddlyWiki
Peter,

Why would you look in info for the date. It is visible in the tiddler subtitle. Go to tiddler $:/core/ui/ViewTemplate/subtitle. and see how that is done.
Tiddler subtitle is right before your eyes when working with your tiddler.

Birthe


Eric Shulman

unread,
Apr 22, 2020, 9:46:50 AM4/22/20
to TiddlyWiki
On Wednesday, April 22, 2020 at 6:18:58 AM UTC-7, Peter Buyze wrote:
Eric, I don't want those last digits because they add absolutely nothing, and they only make reading the date, which lacks dashes, more difficult. I would also like to add dashes.
Thanks for providing the link. How can I get into the ViewWidget, and in there is it just a matter of amending the format?

The values stored in the created and modified fields can be used programmatically to sort tiddlers (e.g., in the filter of a $list widget). While these numbers are not very "readable" by people, they ensure that sorting of tiddlers are accurate.

You can use the $view widget to format these values for display purposes.  For example:
<$view field="modified" format="date" template="YYYY/0MM/0DD 0hh:0mm:0ss" />

enjoy,
-e


Peter Buyze

unread,
Apr 22, 2020, 10:08:54 AM4/22/20
to TiddlyWiki forum
Birthe, the date in the subtitle is the modified date. I am interested in the created date.



22 Apr 2020, 16:46 by strikke...@gmail.com:
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

Peter Buyze

unread,
Apr 22, 2020, 10:10:08 AM4/22/20
to TiddlyWiki forum
Eric, sorry for a basic question, but where is the view widget located?




22 Apr 2020, 16:46 by elsd...@gmail.com:
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

Jed Carty

unread,
Apr 22, 2020, 10:17:47 AM4/22/20
to TiddlyWiki
You can do what you want as described in the documentation here: https://tiddlywiki.com/#ViewWidget:ViewWidget%20DateFormat

<$view field='created' format=date template='DD-MM-YYYY'/>

Birthe C

unread,
Apr 22, 2020, 10:19:14 AM4/22/20
to TiddlyWiki
Peter,
That is why some people edit the tiddler $:/core/ui/ViewTemplate/subtitle. You are right modified field is used here, you could use both modified and created field. I have one to the left and one to the right of my subtitle at least in some of my wikies.

Birthe


den 22. april 2020 kl. 16.08.54 UTC+2 skrev Peter Buyze:
Birthe, the date in the subtitle is the modified date. I am interested in the created date.



22 Apr 2020, 16:46 by strikk...@gmail.com:
Peter,

Why would you look in info for the date. It is visible in the tiddler subtitle. Go to tiddler $:/core/ui/ViewTemplate/subtitle. and see how that is done.
Tiddler subtitle is right before your eyes when working with your tiddler.

Birthe



--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

Eric Shulman

unread,
Apr 22, 2020, 10:48:09 AM4/22/20
to TiddlyWiki
On Wednesday, April 22, 2020 at 7:10:08 AM UTC-7, Peter Buyze wrote:
Eric, sorry for a basic question, but where is the view widget located?

The date that is shown in each tiddler's heading comes from $:/core/ui/ViewTemplate/subtitle

which shows the *modified* date, using this line:
<$view field="modified" format="date" template={{$:/language/Tiddler/DateFormat}}/>

If you change the field="..." parameter value to "created", it will show the creation date of the tiddler.  Alternatively, you could ADD an extra $view widget to show both dates... something like this:
created on &nbsp;
<$view field="created" format="date" template={{$:/language/Tiddler/DateFormat}}/>, 
modified on &nbsp;
<$view field="modified" format="date" template={{$:/language/Tiddler/DateFormat}}/>

Note also that the "template" for this $view widget is a reference to the shadow tiddler,  $:/language/Tiddler/DateFormat, which contains:
DDth MMM YYYY at hh12:0mmam

You can edit this shadow to change the  format of the date output to suit your tastes.
The available formatting codes are defined here: https://tiddlywiki.com/#DateFormat

enjoy,
-e

Peter Buyze

unread,
Apr 22, 2020, 12:08:21 PM4/22/20
to TiddlyWiki forum
Eric, Birthe, thank you. I'm going to go for an extra view widget for the created date, so I will use Eric's code for that.

I imagine I have to create a new tiddler and in the text box put Eric's code. But what title should I give the tid, and should I put anything in the tag field?



22 Apr 2020, 17:48 by elsd...@gmail.com:
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

Mark S.

unread,
Apr 22, 2020, 12:56:49 PM4/22/20
to TiddlyWiki
In other words, if you edit $:/core/ui/ViewTemplate/subtitle, like this:

\whitespace trim
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<div class="tc-subtitle">
<$link to={{!!modifier}} />
M
: <$view field="modified" format="date" template={{$:/language/Tiddler/DateFormat}}/> |
C
: <$view field="created" format="date" template={{$:/language/Tiddler/DateFormat}}/>
</div>
</
$reveal>

Then it will show both the modified and created dates. It's kind of busy though.

When you make modifications to a core tiddler, you should make a note of it, probably in the same TW,
so that when you upgrade you can delete your changes, make the upgrade, and then reinstall.

Otherwise what happens is that after an upgrade and everyone is talking about the exciting new
date field feature, you'll be wondering why you didn't get it. It's easy once you make a change
like this to forget that you ever did it.

Good luck!

On Wednesday, April 22, 2020 at 9:08:21 AM UTC-7, Peter Buyze wrote:
Eric, Birthe, thank you. I'm going to go for an extra view widget for the created date, so I will use Eric's code for that.

I imagine I have to create a new tiddler and in the text box put Eric's code. But what title should I give the tid, and should I put anything in the tag field?



22 Apr 2020, 17:48 by
On Wednesday, April 22, 2020 at 7:10:08 AM UTC-7, Peter Buyze wrote:
Eric, sorry for a basic question, but where is the view widget located?

The date that is shown in each tiddler's heading comes from $:/core/ui/ViewTemplate/subtitle

which shows the *modified* date, using this line:
<$view field="modified" format="date" template={{$:/language/Tiddler/DateFormat}}/>

If you change the field="..." parameter value to "created", it will show the creation date of the tiddler.  Alternatively, you could ADD an extra $view widget to show both dates... something like this:
created on &nbsp;
<$view field="created" format="date" template={{$:/language/Tiddler/DateFormat}}/>, 
modified on &nbsp;
<$view field="modified" format="date" template={{$:/language/Tiddler/DateFormat}}/>

Note also that the "template" for this $view widget is a reference to the shadow tiddler,  $:/language/Tiddler/DateFormat, which contains:
DDth MMM YYYY at hh12:0mmam

You can edit this shadow to change the  format of the date output to suit your tastes.
The available formatting codes are defined here: https://tiddlywiki.com/#DateFormat
enjoy,
-e


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.

Peter Buyze

unread,
Apr 22, 2020, 12:58:56 PM4/22/20
to 'Mark S.' via TiddlyWiki
Thanks for that Mark. Now I'm all set. :-)


22 Apr 2020, 19:56 by tiddl...@googlegroups.com:
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

Mohammad

unread,
Apr 23, 2020, 1:47:41 AM4/23/20
to TiddlyWiki
Added to TW-Scripts
Reply all
Reply to author
Forward
0 new messages