Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Add something to show the duration of the current task #129

Closed
can-I-do opened this issue Nov 27, 2021 · 3 comments
Closed
Assignees

Comments

@can-I-do
Copy link

Is your feature request related to a problem? Please describe.
I want to have a small timer always showing me how long I am working on the current task. I also saw that is setting the start time in 12h and the 24h schema e.g. 2:23pm | Test smth new @done(2021-11-26 15:58)

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
sometimes I just want to know how long am I working on the task and right now I have to calculate :)

Describe the solution you'd like

doing last -d(uration)
24min

that would make things easier to showcase your current task with how long you work on it in a gui or smth like that e.g:
CleanShot 2021-11-27 at 17 03 06

but I want to add for 25mins

@ttscoff
Copy link
Owner

ttscoff commented Nov 28, 2021

Your wish is my...

See the most recent Changelog entry. This applies to the prerelease gem, so to try it out for now, you'll need to do gem install doing --pre. You should get 2.1.2pre or higher.

Basically you can add %duration to any template string. All display commands accept a --duration flag that will enable it to display elapsed time instead of the start-finish interval on unfinished entries. You can also just add duration: true to the config (either to root or to a specific template) and avoid using --duration on the command line. To change the display format from '00:01:24' to '1h 24m', set interval_format: human in config (again, in root or in a template).

Please give it a shot and let me know if that covers the bases for you.

@can-I-do
Copy link
Author

can-I-do commented Nov 29, 2021

oh, that is awesome!!
it kind of works when I add it to a template, like last
doing last Test out (at 12:04pm on Mon, since 0h 23m)
but
doing show -c 1 --duration doesn't show it.
but other than that I didn't get it work, e.g. by providing --duration or adding it in a view
dur: section: Currently count: 1 order: desc template: "%duration" tags_bool: NONE tags: done
error: undefined method `[]' for nil:NilClass

btw can you add your own templates like:
last: date_format: "%-I:%M%P on %a" template: "%title (at %date, since %duration)%odnote" wrap_width: 88 dur: date_format: "%-I:%M%P on %a" template: "%duration" wrap_width: 88

and just call doing dur (doesnt work for me, maybe I am thinking wrong here.)

@can-I-do
Copy link
Author

ah it is working like that in views! Thats enough for me!!! thanks so much!
btt: section: Currently count: 1 order: desc template: "%title -%duration" tags_bool: NONE tags: done

@ttscoff ttscoff closed this as completed Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants