I use Obsidian to keep my daily journal. I created a Shortcuts automation that sends my workout data from my iPhone and creates a page in Obsidian. Then, Dataview makes a table from that data on my daily page. I have the duration set as a simple decimal (“22.4 mins”), but it gets displayed in the table as “22 minutes, 23 seconds, 1000 ms”.
Is there some sort of syntax I can use to force Dataview to display the duration more compactly? I checked this forum and the Dataview GitHub, but can’t find anything.
If allowed, I just add an extra option using the original “22.4 mins” format:
---
duration: 22.4 mins
---
```dataview
TABLE name AS "Name", duration.minutes AS "⏱", ...
```
If your values in duration are only in minutes, then you can use the duration.minutes to get only minutes. If you use duration.hours you get the conversion of the input value (in minutes) to hours: 22.4 mins → 0.3733
Tacking into this, is it possible in the way that dateformat() allows for options to get this to show as hrs instead of hours, m or even mins instead of minutes?
Usecase: Ideally I want to display my sleep diary in the format: 8hrs 20mins
Thanks to this thread, I now have a table with the duration of the files in a folder.
Is there a way to add a line to the table with the sum of all listed durations ?
(or make another Query for the total duration ?)
I tried to get some help from ChatGPT, but that didn’t work out well
I tried using things like: FLATTEN sum(duration.seconds) as Total without success.
I know this is from a while ago, but I’m trying to get my apple workout data into obsidian and was wondering if you would share your Shortcuts autmoation that is doing that? Thank you!