hamster icon indicating copy to clipboard operation
hamster copied to clipboard

Add option to show task duration with fraction of an hour

Open wesleybl opened this issue 4 years ago • 9 comments

I use Hamster to record the duration of my tasks and then register to another system where task durations must be filled in with fractions of an hour. For example:

If a task lasted 2 hours and 30 minutes, I must register 2,5.

Version 3.0.1 has no option to show duration in this way. It is bad to have to calculate the time of all my tasks in order to switch to the other system.

In old versions of Hamters it showed the fractions of hours. But I upgraded my Ubuntu from 16 to 18. In Ubuntu 16 there was a version of Hamter that showed the fractions of an hour. In Ubuntu 18 comes with the option to install version 3.0.1, which shows no fractions.

Does anyone know which version shows fractions? How do I install this version on Ubuntu 18?

wesleybl avatar Mar 31 '20 01:03 wesleybl

From a terminal, hamster export tsv should display fractions of hours (IIRC; can't test, as my motherboard died recently). If you register once a day, that might be fine ?

ederag avatar Mar 31 '20 08:03 ederag

@ederag there isn't hamster command available, only the hamster-snap command. Anyway, I would prefer not to have to type commands. Do you know which version shows the time fractions?

wesleybl avatar Mar 31 '20 12:03 wesleybl

@ederag in the menu there is the Export option, which generates an html in the $HOME/snap folder, which shows times as fractions. The problem is that it creates an html for each day. There will stay full of html. This is a problem?

wesleybl avatar Mar 31 '20 13:03 wesleybl

which version shows the time fractions?

v1 ? See #356

it creates an html for each day

By default; not if you always select the same file to overwrite.

ederag avatar Mar 31 '20 16:03 ederag

By default; not if you always select the same file to overwrite.

Well, having to rename the file before saving isn't a very elegant solution. I can also create a script that cleans the html files in the folder, when the system starts. This is also not very elegant.

I think the display as it was done in the old versions was better. Can we leave this issue open?

wesleybl avatar Apr 01 '20 12:04 wesleybl

@wesleybl, can you please be more specific?

I'm running hamster 3.0.1 here, and the time spent per activity is shown in fractions format in both HTML and TSV exported data. (Btw other users have complained about precisely that, your preference for fractions is a minority position, I think. I personally believe it should be fractions for TSV, for ease of spread sheet import, and minutes for human-readable formats like HTML). The same was true for hamster 2.2.

Wrt the file name, behavior also hasn't changed compared to hamster v2.2. The tool suggests a file name based on the current date, which is a reasonable compromise between readability/length and uniqueness, IMO. If you don't like that, you can change the file name before you click on save. This is very common behavior for an UI tool AFAICT. What else would you prefer?

Anyway, these are two completely separate problems, which should be handled in separate github issues. This one is about the fractions. You'd need to open a new issue for the output file naming.

mwilck avatar Apr 01 '20 13:04 mwilck

@mwilck I'm looking for an easy way to see the day's task durations in a fraction of an hour. See the description of the issue. I am treating html export as a workaround for this. I don't think it's a problem to show in human format. As you said, many people prefer it that way.

wesleybl avatar Apr 02 '20 14:04 wesleybl

@wesleybl: Have a look at report_template.html. If you look at the HTML report, you will see that it can be overridden by copying it to $HOME/.local/share/hamster-time-tracker and editing the template. If you do that and replace $duration by $duration_decimal, you should be set.

mwilck avatar Apr 03 '20 09:04 mwilck

I'm using the HTML export as a work around for this, but it would be nice to see it in decimals on the UI.

+1 for the request!

kevingarman avatar Apr 06 '20 19:04 kevingarman