OK I figured out the changes to add a date column. Only thing left
would be to get the columncalc macro to ignore a line with /%tasktimer
%/. Then one could actually have a static expression which calculates
all the totals automatically.
E.g.,
!!! March 2008
|//Date//|//Description//|//Started//|//Stopped//|//Elapsed//|
|2008-03-09|Comment |20:29:00|23:38:00|03:09:00|
|2008-03-10|Comment 11:15:00|12:40:00|01:25:00|
|2008-03-11|Comment |17:30:00|20:00:00|02:30:00|
/%tasktimer%/
|>|>|>|>|>|
| | | | ''Total:''| <<columncalc sum 1 -3>>|
And here is the local diff of my changes:
--- TaskTimerPlugin 2008-03-12 14:27:33.000000000 +0100
+++ TaskTimerPluginWithDate 2008-03-12 15:32:17.000000000 +0100
@@ -1,5 +1,5 @@
/***
-|Name|TaskTimerPlugin|
+|Name|TaskTimerPluginWithDate|
|Source|
http://www.TiddlyTools.com/#TaskTimerPlugin|
|Documentation|
http://www.TiddlyTools.com/#TaskTimerPluginInfo|
|Version|1.2.2|
@@ -12,7 +12,7 @@
|Description|'timer' button automatically writes start/end/elapsed
time into tiddler content|
Quickly generate 'timed task' logs that can be used for status
reports, billing purposes, etc.
!!!!!Documentation
-> see [[TaskTimerPluginInfo]]
+> see [[TaskTimerPluginInfo]] and for the changes
[[TaskTimerPluginWithDateDiff]]
!!!!!Revisions
<<<
2008.03.10 [*.*.*] plugin size reduction - documentation moved to
[[TaskTimerPluginInfo]]
@@ -28,16 +28,16 @@
config.macros.taskTimer = {
label: "start timer",
title: "press to start the task timer",
- format: "|%0|%1|%2|%3|\\n", // note: double-backslash-en
+ format: "|%0|%1|%2|%3|%4|\\n", // note: double-backslash-en
defText: " ", // default description text
todayKeyword: "today",
todayFormat: "0MM/0DD/YYYY", // default format - superceded by
CalendarPlugin, DatePlugin, or DatePluginConfig
- defHeader: "|//Description//|//Started//|//Stopped//|//Elapsed//|
\n",
+ defHeader: "|//Date//|//Description//|//Started//|//Stopped//|//
Elapsed//|\n",
defTarget: "ActivityReport",
prompt: "Enter a short description for this activity. Press
[cancel] to continue timer.",
askMsg: "Enter the title of a tiddler in which to record this
activity. Press [cancel] to continue timer.",
- createdMsg: "'%0' has been created",
- updatedMsg: "'%0' has been updated",
+ createdMsg: "'%1' has been created",
+ updatedMsg: "'%1' has been updated",
marker: "/%"+"tasktimer"+"%/",
tag: "task",
handler:
function(place,macroName,params,wikifier,paramString,tiddler) {
@@ -92,7 +92,8 @@
var m=diff.getUTCMinutes(); if (m<10) m="0"+m;
var h=diff.getUTCHours(); if (h<10) h="0"+h;
var elapsed=h+":"+m+":"+s;
- var newtxt=before+format.format([txt,start,stop,elapsed])+after;
+ var taskDate=(new Date()).formatString("YYYY-0MM-0DD")
+ var newtxt=before+format.format([taskDate,txt,start,stop,elapsed])
+after;
var newtags=(tiddler?tiddler.tags:['task']); // include 'task' tag
when creating new tiddlers
store.saveTiddler(here.target,here.target,newtxt,config.options.txtUserName,new
Date(),newtags,tiddler?tiddler.fields:null);
if (!tiddler)
displayMessage(this.createdMsg.format([here.target]));
/HeX