On May 23, 9:53 pm, airman99 <airma...@gmail.com> wrote:
> I am using TW as an appointment book, with one journal per day (e.g.
> 2012-05-23). Upon startup, I would like TW to display the next 7 days of
> journal entries. For example, if today is 2012-05-23, I want TW to display
> the journals for 2012-05-23, 2012-05-24, 2012-05-25 ... 2012-05-29. I have
> searched in this group for a while and have not seen this request
> addressed. Have also looked through some of the major plugin sites with no
> progress. Any ideas would be appreciated.

The TWCore uses the contents of [[DefaultTiddlers]] to specify which
tiddlers will be shown at startup.  There is a shadow definition built
into the TWCore that automatically displays [[GettingStarted]] by
default.

Normally, you override the shadow definition by editing
[[DefaultTiddlers]] and entering a static list of tiddler titles to be
opened every time the document is loaded.  However, for your purposes,
you want to define a *variable* list of tiddlers that is automatically
generated based on the current date, rather than statically defined.

To do this, you can create a small custom plugin that overwrites the
TWCore default shadow definition for [[DefaultTiddlers]], like this:

//{{{
var out="";
var now=new Date().getTime(); // current time in msec
var day=86400000; // one day in msec
for (var when=now; when<now+7*day; when+=day)
   out+=new Date(when).formatString("[[YYYY-0MM-0DD]]\n");
config.shadowTiddlers["DefaultTiddlers"]=out;
//}}}

Put the above code into a tiddler (e.g., [[SetDefaultTiddlers]]),
tagged with 'systemConfig'.  If a 'real' [[DefaultTiddlers]] already
exists in your document, delete it so that the shadow
[[DefaultTiddlers]] definition will be applied next time you startup.
Save-and-reload and you're done: the next 7 days of date-titled
tiddlers will be displayed each time you open your document.  QED.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

WAS THIS ANSWER HELPFUL?  IF SO, PLEASE MAKE A DONATION
   http://www.TiddlyTools.com/#Donations

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to tiddlywiki@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to