obsidian-tracker icon indicating copy to clipboard operation
obsidian-tracker copied to clipboard

Support mixed time values/units in summary

Open wenlzhang opened this issue 3 years ago • 8 comments

I use time values for a variable in two daily notes, one in the format of 39min and another 00:30:00. For this, I get wrong results, as shown in the figure: Screenshot 2021-08-31 at 16 26 39

If I use min as the unit in both daily notes, I get the following result: Screenshot 2021-08-31 at 16 25 55

wenlzhang avatar Aug 31 '21 14:08 wenlzhang

Further tests show that it seems time value of the format 00:30:00 is not supported when creating a summary of the form above, as it does not give correct results even if one use 00:30:00 in both notes.

wenlzhang avatar Aug 31 '21 14:08 wenlzhang

Hi @wenlzhang, Thanks for the report. Will check it.

pyrochlore avatar Sep 01 '21 09:09 pyrochlore

Is it possible to do some kind of automatic unit conversion for timing info in summary? For instance, values may be created in the format of 00:30:00 or 30min. When summing all the values up, one may want to display the info in the format of hours, days, etc., e.g. 2 hour, 2 day, etc.

wenlzhang avatar Sep 01 '21 10:09 wenlzhang

@wenlzhang, I have checked it, you are right. The summary output does not accept time values as input for now. Will fix it.

Also, it's hard to make use of 00:30:00 and 30min together. I suggest you use one format for one specific target. For the case of '30 min', Tracker will retrieve the the number of 30 only, not knowing what the unit is. There are too many possibility for units a user can use. For the case of '00:30:00', Tracker can treat it as a time value, but we cannot mixed the two value types.

For the format of a time value output string , it's doable, will add it.

pyrochlore avatar Sep 02 '21 06:09 pyrochlore

Also, it's hard to make use of 00:30:00 and 30min together.

I understand that a mixture of them can be difficult to implement.

For the format of a time value output string , it's doable, will add it.

Looking forward to this! 😃

wenlzhang avatar Sep 02 '21 11:09 wenlzhang

I just realized that it's related to the duration value which we didn't support currently. Will implement it in the next major release.

pyrochlore avatar Sep 12 '21 11:09 pyrochlore

Indeed. I also realize that values of the format 00:03:00 are not actually intercepted as durations, but as time values.

wenlzhang avatar Sep 13 '21 20:09 wenlzhang

This comment not about the summary, but about the source data: I have years of duration data in human-friendly format of, for example, "5h 30m" (for 5 hours and 30 minutes), and “15m” for 15 minutes. Is it possible to implement a duration interpreter that can parse Hours (%H) and Minutes (%M) and Seconds (%S) if desired from arbitrary strings? (use strptime?) The only currently acceptable "%H:%M:%S" format is ugly for me because it looks like a time, not a duration. I use "%Hh %Mm” and "%Mm” if < 1 hour. Other people, like above, might use “%M min”.

ces3001 avatar Jun 29 '22 19:06 ces3001