I am trying to accomplish a logbook functionality in TiddlyWiki where I am able to list Tiddlers and calculate various aggregated times.
So far I have been unsuccessful in accomplishing the following:
Say that we have the tiddlers
Tiddler A with fields
time 1: 10:10
time 2: 11:05
and Tiddler B with fields
time 1: 09:45
time 2: 10:05
Now I want to be able to write a filter which selects returns the time difference between time 1 and time 2 and then summed, which would return 0:55 + 0:20 = 1:15 in this example.
Is this possible with just core TiddlyWiki functionality or do I have to write my own Javascript macros and/or filter operators? I would like to avoid relying on having to store states in fields or temporary tiddlers if possible.
If these times are always on the same day this should be achievable, you just need to detect when hours exceed 23 or are less than 0, minutes greater than 59 and less than zero.
However you may find something to help in this large collection of great time and date tools by Eric. You may find it easier to use these tools to set ands manage the times. Otherwise date and time calculations can be done with other plugins.
I could wrap the filter expression in a list widget but then I don’t know how to sum the results. I could also store the time duration in minutes in a field in the respective tiddler but I want to avoid that since t1 and t2 should be enough information to do the calculations.
From what I understand https://tiddlytools.com/timer.html relies on button actions to store durations. I want to avoid that if possible as I want to be able to change t1 for example and have all calculations update automatically.
I’m still figuring out how to comfortable break out functionality into multiple sub-macros. It’s hard to break the notion of treating macros as functions and avoiding macro calls in attribute assignments.