I use TiddlyWiki as a task manager, among other things, and I thought it would be cool to know how long I spent working on a completed task.Off the top of my head I imagine having a "start/stop" button that will alternately add a timestamp to the fields "start" and "stop". Then I could (hopefully) create a macro that calculates the total time spent on the task.
\define startbutton()
<$button> start
<$action-setfield start=<<now YYYY0MM0DD0hh0mm0ss0XXX>>/>
<$action-setfield stop=""/>
<$action-setfield elapsed=""/>
</$button>
\end
\define stopbutton()
<$button> stop
<$action-setfield stop=<<now YYYY0MM0DD0hh0mm0ss0XXX>>/>
<$action-setfield elapsed={{{ [{!!stop}subtract{!!start}] }}}/>
</$button>
\end
\define showtable()
<$vars min={{{ [{!!elapsed}divide[60000]trunc[]] }}}>
<$vars minsec={{{ [<min>multiply[60]] }}}>
<$vars sec={{{ [{!!elapsed}divide[1000]subtract<minsec>multiply[1000]trunc[]divide[1000]] }}}>
| started:|<$view field="start" format="date" template="[UTC]MMM DD YYYY 0hh:0mm:0ss.0XXX" />|
| stopped:| <$view field="stop" format="date" template="[UTC]MMM DD YYYY 0hh:0mm:0ss.0XXX" />|
| elapsed:|<<min>> minutes <<sec>> seconds|
</$vars>
</$vars>
</$vars>
\end
<$reveal default={{!!start}} type="match" text="">
<<startbutton>>
</$reveal>
<$reveal default={{!!start}} type="nomatch" text="">
<$reveal default={{!!stop}} type="match" text="">
<<stopbutton>>
</$reveal>
<$reveal default={{!!stop}} type="nomatch" text="">
<<startbutton>>
</$reveal>
</$reveal>
<<showtable>>
{{||Timer}}
\define startbutton()
<$button> start
<$set name="current-time" value=<<now YYYY0MM0DD0hh0mm0ss0XXX>> >
<$action-setfield start={{{ [{!!start}addsuffix[ ]addsuffix<current-time>] }}}/>
<$action-setfield current-button="stop"/>
</$set>
</$button>
\end
\define stopbutton()
<$button> stop
<$set name="current-time" value=<<now YYYY0MM0DD0hh0mm0ss0XXX>> >
<$action-setfield stop={{{ [{!!stop}addsuffix[ ]addsuffix<current-time>] }}}/>
<$action-setfield elapsed={{{ [{!!stop}subtract{!!start}] }}}/>
<$action-setfield current-button="start"/>
</$set>
</$button>
\end
\define showtable()
<$vars min={{{ [{!!elapsed}divide[60000]trunc[]] }}}>
<$vars minsec={{{ [<min>multiply[60]] }}}>
<$vars sec={{{ [{!!elapsed}divide[1000]subtract<minsec>multiply[1000]trunc[]divide[1000]] }}}>
| started:|<$view field="start" format="date" template="[UTC]MMM DD YYYY 0hh:0mm:0ss.0XXX" />|
| stopped:| <$view field="stop" format="date" template="[UTC]MMM DD YYYY 0hh:0mm:0ss.0XXX" />|
| elapsed:|<<min>> minutes <<sec>> seconds|
</$vars>
</$vars>
<
/$vars>
\end
<$reveal default={{!!current-button}} type="nomatch" text="stop">
<<startbutton>>
</$reveal>
<$reveal default={{!!current-button}} type="match" text="stop">
<<stopbutton>>
</$reveal>
<<showtable>>
Wow Eric that's great thank you!
I think what's missing is the ability to record time for the same task across multiple sessions.I've edited some of your code so that the start/stop buttons don't erase the field, but just add the new timestamps to the end of the field. This way the "start" and "stop" fields contain a list of all the times you started and stopped the timer.What I can't figure out is how to calculate the total elapsed time. What I need to do is calculate the difference between the last timestamp in the "start" and "stop" fields each time I press the stop button, then sum all of these values.
\define start_timer()
<$button actions="""
<$vars time=<<now YYYY0MM0DD0hh0mm0ss0XXX>> >
<$action-setfield startlist={{{ [{!!startlist}addsuffix[ ]addsuffix<time>trim[]] }}}/>
<$action-setfield started=<<time>> stopped="" elapsed=""/>
<$action-setfield button="stop"/>
</$vars>
"""> start
</$button>
\end
\define stop_timer()
<$button actions="""
<$vars time=<<now YYYY0MM0DD0hh0mm0ss0XXX>> >
<$action-setfield stoplist={{{ [{!!stoplist}addsuffix[ ]addsuffix<time>trim[]] }}}/>
<$vars
msec={{{ [{!!started}split[]last[5]join[]] }}}
min={{{ [{!!started}split[]butlast[5]last[2]join[]multiply[60]] }}}
hour={{{ [{!!started}split[]butlast[7]last[2]join[]multiply[3600]] }}}
day={{{ [{!!started}split[]butlast[9]last[2]join[]multiply[86400]] }}}>
<$vars start={{{ [<msec>add<min>add<hour>add<day>] }}}>
<$vars
msec={{{ [<time>split[]last[5]join[]] }}}
min={{{ [<time>split[]butlast[5]last[2]join[]multiply[60]] }}}
hour={{{ [<time>split[]butlast[7]last[2]join[]multiply[3600]] }}}
day={{{ [<time>split[]butlast[9]last[2]join[]multiply[86400]] }}}>
<$vars stop={{{ [<msec>add<min>add<hour>add<day>] }}}>
<$action-setfield stopped=<<time>> elapsed={{{ [<stop>subtract<start>] }}}/>
<$action-setfield total={{{ [{!!total}add{!!elapsed}] }}}/>
<$action-setfield button="start"/>
</$vars>
</$vars>
</$vars>
</$vars>
</$vars>
"""> stop
</$button>
\end
\define reset_timer()
<$button> reset
<$action-deletefield startlist stoplist started stopped elapsed total button />
</$button>
\end
\define showtable()
<$vars
elapsed_min={{{ [{!!elapsed}divide[60000]trunc[]] }}}
elapsed_minsec={{{ [<elapsed_min>multiply[60]] }}}
elapsed_sec={{{ [{!!elapsed}divide[1000]subtract<elapsed_minsec>multiply[1000]trunc[]divide[1000]] }}}>
<$vars
total_min={{{ [{!!total}divide[60000]trunc[]] }}}
total_minsec={{{ [<total_min>multiply[60]] }}}
total_sec={{{ [{!!total}divide[1000]subtract<total_minsec>multiply[1000]trunc[]divide[1000]] }}}>
| started:|<$view field="started" format="date" template="[UTC]MMM DD YYYY 0hh:0mm:0ss.0XXX" />|
| stopped:|<$view field="stopped" format="date" template="[UTC]MMM DD YYYY 0hh:0mm:0ss.0XXX" />|
| elapsed:|<<elapsed_min>> minutes <<elapsed_sec>> seconds|
| total:|<<total_min>> minutes <<total_sec>> seconds|
</$vars>
</$vars>
\end
<$reveal default={{!!button}} type="nomatch" text="stop">
<<start_timer>> <<reset_timer>>
</$reveal>
<$reveal default={{!!button}} type="match" text="stop">
<<stop_timer>> <<reset_timer>>
</$reveal>
<<showtable>>
{{||Timer}}
This has some cute code patterns in it, like second padded field. Love your work.Before delving in, in detail have you accounted for tasks active across midnight?
\define start_timer()
<$button actions="""
<$vars time=<<now YYYY0MM0DD0hh0mm0ss0XXX>> >
<$action-setfield startlist={{{ [{!!startlist}addsuffix[ ]addsuffix<time>trim[]] }}}/>
<$action-setfield started=<<time>> stopped="" elapsed=""/>
<$action-setfield button="stop"/>
</$vars>
"""> start
</$button>
\end
\define stop_timer()
<$button actions="""
<$vars time=<<now YYYY0MM0DD0hh0mm0ss0XXX>> >
<$action-setfield stoplist={{{ [{!!stoplist}addsuffix[ ]addsuffix<time>trim[]] }}}/>
<
$vars
msec={{{ [{!!started}split[]last[3]join[]divide[1000]] }}}
sec={{{ [{!!started}split[]butlast[3]last[2]join[]] }}}
min={{{ [{!!started}split[]butlast[5]last[2]join[]multiply[60]] }}}
hour={{{ [{!!started}split[]butlast[7]last[2]join[]multiply[3600]] }}}
day={{{ [{!!started}split[]butlast[9]last[2]join[]multiply[86400]] }}}>
<$vars start={{{ [<msec>add<sec>add<min>add<hour>add<day>] }}}>
<$vars
msec={{{ [<time>split[]last[3]join[]divide[1000]] }}}
sec={{{ [<time>split[]butlast[3]last[2]join[]] }}}
min={{{ [<time>split[]butlast[5]last[2]join[]multiply[60]] }}}
hour={{{ [<time>split[]butlast[7]last[2]join[]multiply[3600]] }}}
day={{{ [<time>split[]butlast[9]last[2]join[]multiply[86400]] }}}>
<$vars stop={{{ [<msec>add<sec>add<min>add<hour>add<day>] }}}>
<$action-setfield stopped=<<time>> elapsed={{{ [<stop>subtract<start>] }}}/>
<$action-setfield total={{{ [{!!total}add{!!elapsed}] }}}/>
<$action-setfield button="start"/>
</$vars>
</$vars>
</$vars>
</$vars>
</$vars>
"""> stop
</$button>
\end
\define reset_timer()
<$button> reset
<$action-deletefield startlist stoplist started stopped elapsed total button />
<
/$button>
\end
\define showtable()
<$vars
elapsed_min={{{ [{!!elapsed}divide[60]trunc[]] }}}
elapsed_minsec={{{ [<elapsed_min>multiply[60]] }}}
elapsed_sec={{{ [{!!elapsed}subtract<elapsed_minsec>multiply[1000]trunc[]divide[1000]] }}}>
<$vars
total_min={{{ [{!!total}divide[60]trunc[]] }}}
total_minsec={{{ [<total_min>multiply[60]] }}}
total_sec={{{ [{!!total}subtract<total_minsec>multiply[1000]trunc[]divide[1000]] }}}>
| started:|<$view field="started" format="date" template="[UTC]MMM DD YYYY 0hh:0mm:0ss.0XXX" /
>|
| stopped:|<$view field="stopped" format="date" template="[UTC]MMM DD YYYY 0hh:0mm:0ss.0XXX" />|
| elapsed:|<<elapsed_min>> minutes <<elapsed_sec>> seconds|
| total:|<<total_min>> minutes <<total_sec>> seconds|
</$vars>
</$vars>
\end
<$reveal default={{!!button}} type="nomatch" text="stop">
<<start_timer>> <<reset_timer>>
</$reveal>
<$reveal default={{!!button}} type="match" text="stop">
<<stop_timer>> <<reset_timer>>
</$reveal>
<<showtable>>
<$vars
elapsed_min={{{ [{!!elapsed}divide[60]trunc[]] }}}
elapsed_minsec={{{ [<elapsed_min>multiply[60]] }}}
elapsed_sec={{{ [{!!elapsed}subtract<elapsed_minsec>multiply[1000]trunc[]divide[1000]] }}}>
<$vars
total_min={{{ [{!!total}divide[60]trunc[]] }}}
total_minsec={{{ [<total_min>multiply[60]] }}}
total_sec={{{ [{!!total}subtract<total_minsec>multiply[1000]trunc[]divide[1000]] }}}>
<$vars elapsed_min={{{ [{!!elapsed}divide[60]trunc[]] }}}>
<$vars elapsed_minsec={{{ [<elapsed_min>multiply[60]] }}}>
<$vars elapsed_sec={{{ [{!!elapsed}subtract<elapsed_minsec>multiply[1000]trunc[]divide[1000]] }}}>
<$vars total_min={{{ [{!!total}divide[60]trunc[]] }}}>
<$vars total_minsec={{{ [<total_min>multiply[60]] }}}>
<$vars total_sec={{{ [{!!total}subtract<total_minsec>multiply[1000]trunc[]divide[1000]] }}}>
... if you were to "start" a timer and then save the file. Then, when you reload later, you could "stop" the timer and it would calculate the difference to get the elapsed time.
Aha, I assumed this TW5 version worked like the TWC version of yours. But so something like your TWC version could in fact be used to auto-perform tasks assuming the TW is running in the browser. Good to know.
<$action-timeout id="..." delay="..." actions="""...""" />
I just created a new widget: $action-timeout,
... autostart="yes" ... I'm not sure when this param will be useful
... "auto-perform tasks" ... could be the next *big* enhancement
However... I've also added another param, autostart="yes", which will actually trigger the $action-timeout as soon as it is rendered, even if it's not inside a $button.I'm not sure when this param will be useful, and it's best to consider it "experimental" for now.
Automatically triggering actions can be very useful, to create eg: automatic TW UI tests. ... On the other hand, if done wrong it can be very destructive (trust me!).
... autostart="yes" ... I'm not sure when this param will be useful... "auto-perform tasks" ... could be the next *big* enhancementWell, that next big enhancement could - I think - be a partial solution for the current TWederation implementation to function better.
Cool stuff here!
Cheers,
Thomas
On Sunday, July 19, 2020 at 7:39:34 AM UTC+2, Eric Shulman wrote:However... I've also added another param, autostart="yes", which will actually trigger the $action-timeout as soon as it is rendered, even if it's not inside a $button.I'm not sure when this param will be useful, and it's best to consider it "experimental" for now.
@Eric. ... I personally would create 2 plugins. 1 with the "useful" timeout and 1 with the potentially dangerous "experimental" parameter.
\define ticker_actions()
<$action-timeout delay="1000" id="$(currentTiddler)$" actions="""
<$list filter="[[$(currentTiddler)$]is[tiddler]]">
<$action-setfield $timestamp="no" now=<<now YYYY0MM0DD0hh0mm0ss0XXX>> />
<$reveal default={{!!stop}} type="match" text="">
<$importvariables filter="TiddlyTools/Timer"> <<ticker_actions>> </$importvariables>
</$reveal>
</$list>
""" />
\end
To join in the fun, I also made a $action-delay widget that delays the execution of any action widgets contained inside it by a set time. It is an action widget so it gets triggered by the normal mechanisms.
I wonder if anyone has done something similar, or has a different approach worth sharing?
I use TiddlyWiki as a task manager, among other things, and I thought it would be cool to know how long I spent working on a completed task.Off the top of my head I imagine having a "start/stop" button that will alternately add a timestamp to the fields "start" and "stop". Then I could (hopefully) create a macro that calculates the total time spent on the task.
I wonder if anyone has done something similar, or has a different approach worth sharing?
I made a quick attempt to make a countdown timer (for an InstantBoss as mentioned previously in this thread) but it didn't really work out well. Basically I took a time, e.g 10 minutes and, in a filter, subtracted the timer value. How would you propose to use your timer for this?
{{||TiddlyTools/Timer/CountDown}}
I've just posted an update with a new tiddler:
Coming soon: display a message when the countdown reaches 0
Let me know if you have any additional features you want it to do.
Thanks for asking! As noted, I'm hoping to use TW like an InstantBoss so I can set several consecutive timers; a typical session is "workduration + breakduration * reps", e.g 10+2 * 5. i.e for a total of one hour. If I understand your code, all "getTime" are started with "doStart" so I'm not sure how such multiple consecutive timers can be run?
"Programmed Countdown Sequences" (aka, "consecutive timers").
Give it a try and let me know what you think.
- When the first countdown ends, you will get an additional minute.
- When the second countdown ends, you will get an additional 30 seconds.
- When the third countdown ends, the sequence is completed.
Eric Shulman wrote:"Programmed Countdown Sequences" (aka, "consecutive timers").Give it a try and let me know what you think.Looks great! I am totally confusded by the notes there though, i.e:
- When the first countdown ends, you will get an additional minute.
"First" should probably read "third" (counting from left), or better yet, "the seconds countdown"? Or maybe you do refer to the hours countdown and the bug you mention so when the hours are ended, there is buggily an extra minute ended?
- When the second countdown ends, you will get an additional 30 seconds.
...???
- When the third countdown ends, the sequence is completed.
I hope that helps explain things a bit better...
\define firstDone()<$list filter="[range[5]]" variable="_NUL"><$list filter="00:00:03 00:00:06" variable=duration><$vars H={{{ [<duration>split[:]nth[1]] }}} M={{{ [<duration>split[:]nth[2]] }}} S={{{ [<duration>split[:]nth[3]] }}}><$macrocall $name=setCountdown H=<<H>> M=<<M>> S=<<S>> /></$vars></$list></$list>\end
\define controls()
<$vars here=<<currentTiddler>>>
<$vars done=<<firstDone>>>
<<getCountdown>> <<start>> <<stop>> <<reset>>
\end
So do I understand it right that to achieve a repetition of 10minutes + 2minutes * 5times, I'd need to, in the tiddler, type in about 10 calls, right? I made a quick, but failed attempt to modify firstDone into:
\define firstDone()<$list filter="[range[5]]" variable="_NUL"><$list filter="00:00:03 00:00:06" variable=duration><$varsH={{{ [<duration>split[:]nth[1]] }}}M={{{ [<duration>split[:]nth[2]] }}}S={{{ [<duration>split[:]nth[3]] }}}><$macrocall $name=setCountdown H=<<H>> M=<<M>> S=<<S>> /></$vars></$list></$list>\end
\define firstDone()
<<showMessage "First Countdown ended. You have another minute!">>
<$vars done=<<secondDone>>>
<<setCountdown 00 01 00>>
\end
I must also ask something else - what kind of syntax is this:
\define controls()
<$vars here=<<currentTiddler>>>
<$vars done=<<firstDone>>>
<<getCountdown>> <<start>> <<stop>> <<reset>>
\end
...i.e no closing vars tags!? I know one *can* do that but is the system OK with it? No sideeffects?
\define showRemaining()
<$tiddler tiddler=<<temp>>>
<$vars R={{{ [<temp>get[text]subtract[1]] }}}>
<$vars H={{{ [<R>divide[3600]trunc[]] }}}>
<$vars HM={{{ [<H>multiply[60]] }}}>
<$vars M={{{ [<R>divide[60]subtract<HM>trunc[]] }}}>
<$vars HS={{{ [<H>multiply[3600]] }}}>
<$vars MS={{{ [<M>multiply[60]] }}}>
<$vars S={{{ [<R>subtract<HS>subtract<MS>] }}}>
<$action-setfield hours={{{ [<H>addprefix[00]split[]last[2]join[]] }}} />
<$action-setfield mins={{{ [<M>addprefix[00]split[]last[2]join[]] }}} />
<$action-setfield secs={{{ [<S>addprefix[00]split[]last[2]join[]] }}} />
\end
There is *currently* no easy syntax for setting up a repeating pattern of countdowns.That is something I will be adding soon.In the mean time, to do the one hour cycle you described, you would need to
[...]
Yeah. When the end of a macro is reached, any unterminated widgets are automatically terminated.
Eric Shulman wrote:There is *currently* no easy syntax for setting up a repeating pattern of countdowns.That is something I will be adding soon.
* SampleCountdownSequence now does cycles!
Demo is 10 minutes work session followed by 2 minutes break time, repeated 5 times(1 hour total).
Let me know what else it should do...
Eric Shulman wrote:* SampleCountdownSequence now does cycles!Yehaaww!Demo is 10 minutes work session followed by 2 minutes break time, repeated 5 times(1 hour total).Good demo choice ;-) ;-)Let me know what else it should do...1) RSOE at when worksession 4 break is to start. "Uncaught RangeError: Maximum call stack size exceeded"
2) For the practical use of these CountdownSequences, it would be neat if it is possible to define sessions that one can select. I imagine a little form where you fill in the session name and its steps, something like so (copied straight from my actual routine)
Daily WorksessionRead book : 30 mLunch : 2 mTiddleFiddle : 10:30 hFamily dinner : 5 mExercise before breakfastPushups : 2:59 hRun 15 km : 15 mIce-bath : 3 h
3) If one doesn't dismiss a modal, the subsequent modals will (eventually) pile on in front. (Interestingly, also the dark surrounding the modal is added so it gets darker and darker). Maybe a modal should clear any preceding modal?
Thank you!
1) RSOE
I have not seen this error, and I've run through the whole sequence of 5 work sessions/break times (with shortened times of 1 minute work and 15 seconds break). Can you tell me more about what happened? Can you reproduce it with the latest version (just updated to add configuration controls)
Also... you only spend 2 minutes for lunch and 5 minutes for dinner, but 3 hours for an ice-bath?!?and you can run 15km in just 15 minutes?!? WOW!
I need to look into this a bit to figure out how to programatically dismiss an existing modal.
Eric Shulman wrote:1) RSOEI have not seen this error, and I've run through the whole sequence of 5 work sessions/break times (with shortened times of 1 minute work and 15 seconds break). Can you tell me more about what happened? Can you reproduce it with the latest version (just updated to add configuration controls)Yes, having tried it now several times I do get it to happen repeatedly in the latest version: I just leave the default(!) values and start the countdown and let it run while I do other stuff in other tabs. I do peek back every now and then to see how things were going. Unfortunately I can't say after exactly how long time it happens but my best estimation is after some three sessions. Not faster.I'm on Win10, Chrome.
I need to look into this a bit to figure out how to programatically dismiss an existing modal.
Perhaps worth considering that they don't have to be modals. Just sayin'. Apropos modals, here's an interesting css based variant- basically the thing you want to show has a pseudoelement beneath it with dark color that covers the whole screen. (...or maybe that is exactly how a ...
uh oh. This suggests something bad about how my $action-timeout code works. Since the timeout widget re-invokes itself each second, I think it's leaving behind the previous "timed out" widget object, resulting in a slow accumulation of junk on the call stack. This is *very* bad. I will have to think about ways to re-write the underlying JS to not do this. This likely also affects the basic "timer" functionality (if the timer runs too long).
I need to look into this a bit to figure out how to programatically dismiss an existing modal.
Silly question: How do I install this?
I did some experimenting, and it doesn't look like modals can be programmatically dismissed. Some alternatives I can think of:1) Use tm-notify to put up the message. These messages automatically go away (by default, after 3 seconds). My concern is that the message might not be as noticeable.2) Don't use ANY TWCore message, but simply write the status into a separate tiddler. Then, just transclude that tiddler's content somewhere (maybe with an ok/hide button)3) Possibly combine (2) with a modal-like display. Since the tiddler in (2) would be overwritten each time, the previous display would automatically vanish.
- What function do you see the pause-able clock playing?
- One could click it when starting work and review it
- But I wonder if you have another idea in mind.
Feature request
- Perhaps this already possible, but is it possible to trigger some actions defined in a tiddler or macro when a timer completes?
- I ask this because then any set of actions can be triggered.
- One could send a message to save 15 mins after the last save or regularly.
- Or in startup set a count down to open a modal 10 minutes
- Perhaps even a timer to save and logout/check in after 30 minutes of inactivity
This solution really benefits from you being the author with you extensive knowledge, because timing solutions can kill an app or software, if not done correctly, so this is greatly appreciated.
In some cases we do not need to keep the time start and end history, and the total time work can be added to the previous total.
I imagine for example having a sidebar with a set of elapsed timers where one would click while working on correspondence, phone calls, coding, customer relations social media etc... Saving total for at the end of day in a journal tiddler, but starting afresh each day. This would support a range of productivity methods suggested in time management and productivity methods.
The new Timer/AutoSaver (just wrote it tonight!!!) invokes a tm-save-file message to actually save the file.
Eric Shulman wrote:uh oh. This suggests something bad about how my $action-timeout code works. Since the timeout widget re-invokes itself each second, I think it's leaving behind the previous "timed out" widget object, resulting in a slow accumulation of junk on the call stack. This is *very* bad. I will have to think about ways to re-write the underlying JS to not do this. This likely also affects the basic "timer" functionality (if the timer runs too long).:-/ sorry. BUT before anything; did you or anyone else succeed to recreate the problem?
Another conceptual approach: I note that InstantBoss instead functions in another way and which possibly makes more sense: It demands that the user actively dismisses the popup in order to start the next countdown. After all, if you're not attentive to the alert, then what's the point in having it continue to count down on your next task? IMO it makes sense: If one wants an unstoppable countdown... then it's just a backward counting clock! Demanding that the user actually starts the next countdown is actually giving control to the user.BTW, even if you were not to agree with that logic, it is a functionality that I know is useful so I guess it's a feature request then :-)
Fabulously flexible and useful tool! Could replace the smorgasbord of not-interworking time tools I currently use.In one vital case I'd like to trigger sound alarms on end of countdowns (alerts for taking tablets).I can't quite see how to do that yet. Could you give a clue so I can implement that?
On Friday, July 31, 2020 at 11:41:26 AM UTC-7, TiddlyTweeter wrote:Fabulously flexible and useful tool! Could replace the smorgasbord of not-interworking time tools I currently use.In one vital case I'd like to trigger sound alarms on end of countdowns (alerts for taking tablets).I can't quite see how to do that yet. Could you give a clue so I can implement that?I will be adding another feature to the Timer/Countdown, so that you can specify a separate tiddlercontaining $action-* widgets that will be invoked when the countdown reaches zero.
To invoke additional custom actions when the countdown is completed:
<$action-... />
widget syntax into the body of that tiddler.Thanks for the timer actions it adds a powerful dimension.This is more than enough for many applications however perhaps in future we could supply the action tiddlername as a variable or parameter.
To define custom actions to be performed when the countdown is completed:
done
in the tiddler containing your countdown timer. This macro replaces the standard message box.<$action-... />
widget syntax inside the macro definition.$(here)$
to refer to the title of tiddler containing your countdown timer.<<showMessage msg:"your message here">>
I am very likely to have one action definition that is used many times and it would be nice to have one defined in this case, also allowing for one to be modified, affecting all that use that action tiddler.
\define done() <$transclude tiddler="MyCommonDoneAction" />
I've just added an *optional* setting to "pause between sessions".
Before attempting to hack the clocks can you see an easy way to set them to operate in different time Zone's?
The world clocks are wonderful, My family use is likely to be Australia and France, and perhaps other Australian Time Zones, so we only need two or more clocks to make this a valuable feature. I will see if I can source a Time Zone list, as tiddlywiki data, then one may select only the time zone perhaps that we want to phone. A little css play to show daylight/nighttime would be fun but in no way essential. That is for people to play with.
Thanks again for your contribution, superb.
Unfortunately, I've just found a nasty logic error in my handling for timezone. It doesn't work right when calculating across date boundaries. For example, my time zone is UTC-7 (Pacific Time), and I was converting from GMT to local time by simply subtracting the number of hours. But... when its just after 5pm here the hour is 17, but in GMT, it's just after midnight *the next day* and the hours there is 00, so simply subtracting the timezone offset give hour 93 (00 - 07)!!!
I'll let you know when I have a *working* update!
I am from Denmark. Copenhagen is GMT+1, but right now we have summertime GMT+2. I guess summertime also will represent problems around the globe.
<<showClock "local time" >> <<showClock "Honolulu" -1000>> <<showClock "Los Angeles" -0700>><br>
<<showClock "New York" -0400>> <<showClock "London" +0100>> <<showClock "Rome" +0200>><br>
<<showClock "Moscow" +0300>> <<showClock "Tokyo" +0900>> <<showClock "Sydney" +1000>><br>
The AnalogClock and DigitalClock now support optionally specifying the timezone offset.
The math was tricky... and it still has two issues to deal with:1) It needs to handle MONTH date adjustments (i.e., when it's the evening of 8/31 somewhere, it will be 9/01 somewhere else)
The AnalogClock and DigitalClock now support optionally specifying the timezone offset.
2) It needs to handle MINUTE timezone offset (there's a few timezones that aren't on the even hours.... especially in Australia!)
<$set name="dpm" value="31 28 31 30 31 30 31 31 30 31 30 31"> <!-- days per month -->
<$set name="dm" value={{{ [<dpm>split[ ]nth<mm>] }}}> <!-- days in this month -->
<$vars leap={{{ [<yyyy>divide[4]split[.]count[]match[1]then[yes]] }}}>
<$set name="dpm" value="31 28 31 30 31 30 31 31 30 31 30 31">
<!-- days per month -->
<$set name="dpm" filter="[<leap>!match[]]" value="31 29 31 30 31 30 31 31 30 31 30 31" emptyValue=<<dpm>>>
Eric,
Thanks as always,
Pit.W
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/07bb6406-7509-437e-8eb2-3682793e79beo%40googlegroups.com.
_________________________________________________________________ ________________________________________________________ Ihre E-Mail-Postfächer sicher & zentral an einem Ort. Jetzt wechseln und alte E-Mail-Adresse mitnehmen! https://www.eclipso.de
No problems running it so far. It exactly meets what I need for a task I am working on, so I use it for productivity. All fine so far.
Do you plan to pack this into a plugin?
I propose to set the default formats for date and time to ISO 8601 https://en.wikipedia.org/wiki/ISO_8601, to ease the use for newcomers.
Displays a digital AlarmClock that can have multiple alarms set.
This is fabulous. I was thinking of placing two world clock on a site. I realised that your solutions are contained in a set of tiddlers with a given prefix and I was not sure which are dependencies and which are options.
Have you planed to package these in a particular way or can you provide a little guidance as to how we can take these wonderful tools to our wikis?
I am happy to package these as needed for myself but would like a little guidance on this. Perhaps I should already understand this but I am uncertain. I have followed your development journey and are very impressed but not confident I know how to select or bundle these. I am aware as developer it can be hard to imagin what a nieve user will understand when you have such a deep knowledge since you built it.
I am very excited with the possibilities you have opened up to us all, and certainly plan to share some implementations back.
Thanks
Tones
... I was not sure which are dependencies and which are options.
Have you planed to package these in a particular way or can you provide a little guidance as to how we can take these wonderful tools to our wikis?
\define ticker(delay:1000)
<$action-timeout delay="$delay$" actions="""
<$action-setfield $tiddler="$:/temp/timer/ticker" text=<<now [UTC]YYYY0MM0DD0hh0mm0ss0XXX>> />
<$importvariables filter="TiddlyTools/Timer/Alarms"> <<alarms_check>> </$importvariables>
<$importvariables filter="TiddlyTools/Timer/CountDown"> <<countdown_tick>> </$importvariables>
<!-- ADJUST FOR MSEC DRIFT DUE TO PROCESSING OVERHEAD -->
<$vars msec=<<now "0XXX">>><$vars delay={{{ [[1000]subtract<msec>] }}}>
<$macrocall $name="ticker" delay=<<delay>> />
</$vars></$vars>
"""/>
\end
<<ticker>>
An observation fyi but no expectation of remedy, my windows HTA version the clock in the sidebar does not tick.
Regards
Tony
An observation fyi but no expectation of remedy, my windows HTA version the clock in the sidebar does not tick.
On Monday, August 17, 2020 at 7:32:27 PM UTC-7, TW Tones wrote:An observation fyi but no expectation of remedy, my windows HTA version the clock in the sidebar does not tick.
Whilst I can enter an alarm that repeats every day at http://tiddlytools.com/timer.html, it doesn't work in my wiki - I can set alarms once but the daily alarm doesn't retain the time for some reason. Any ideas?
Also, are alarms which have expired whilst the computer has been turned off supposed to trigger when switched back on as I can't reproduce that?
is it possible to trigger , start or stop a timer automatically if a certain criteria is met? so similar to a CRM ticketing tool, creating and saving a new tiddler would automatically start a timer , or maybe creating a new tiddler with a specific Tag would trigger a predefined duration ?
how can i add a value in a field automatically after an alarm is triggered, so asside from the popup message ,i also want a field to say "done" for example?