I am trying to calculate the total worktime hours in my daily notes, so that I could use dataview TABLE in a weekly overview to show this calculation.
Since I have multiple irregular breaks during the day I want to write down every work session’s start and end time in a format HH:MM and then calculate the total time.
total work time:: =dur(this.work1) + dur(this.work2)
I thought that dur() function accepts any data type, but apparently it cant calculate this weird string which is “work1” and “work2”
This is the output:
Thank you! This solves the issue.
I have literally tried everything but this simple solution.
I actually don’t mind the lengthiness of the field, most importantly - it works.
Just a quick note for those who are doing this silly thing here.
If you have setup inline fields (in your daily template) for some number of work sessions, and if you don’t fill out all of them, then it gives you an error saying it can’t calculate null + duration.
It this case you can use default() function to replace null with 0s duration. Here is the code for 5 work sessions: