[Another post on the ongoing quest for a static site.]
One of the other things I've had to override is the subtitle behavior on
tiddlers. On a normal TW, when you create a new tiddler and save it, the
subtitle will read something like "Jim 1 second ago", that is, the last
modified time is displayed as a "relative date." It then ages over a period
of minutes, hours, days and weeks and so on (see *getRelativeDate *in
*utils.js*). The problem with that behavior on a static site is that it is
"frozen in time" when you generate. If a given tiddler was showing "1 hour
ago" when you generated the static pages, then the resulting static HTML
page will *always *show "1 hour ago", forever. Which is probably not what
you want.
To get around that, I overrode the shadow *$:/core/ui/ViewTemplate/subtitle*
tiddler, which looks like this out of the box:
<div class="tc-subtitle">
<$link to={{!!modifier}}>
<$view field="modifier"/>
</$link> <$view field="modified" format="relativedate"/>
</div>
I changed the *$view *of the *modified *field as shown below in *red* to
always show a date in "Thursday, November 27, 2014" format:
<div class="tc-subtitle">
<$link to={{!!modifier}}>
<$view field="modifier"/>
</$link> <$view field="modified" format="date" template="DDD, MMM DD,
YYYY"/></div>
Problem solved.
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.