After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 675833 - Overview - Activities calculates durations incorrectly
Overview - Activities calculates durations incorrectly
Status: RESOLVED OBSOLETE
Product: hamster-applet
Classification: Deprecated
Component: general
2.30.x
Other Linux
: Normal normal
: ---
Assigned To: hamster-applet-maint
hamster-applet-maint
Depends on:
Blocks:
 
 
Reported: 2012-05-10 18:13 UTC by Daniel Preston
Modified: 2012-09-24 19:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot with and without the attached fix (56.39 KB, image/jpeg)
2012-05-10 18:13 UTC, Daniel Preston
Details

Description Daniel Preston 2012-05-10 18:13:07 UTC
Created attachment 213827 [details]
screenshot with and without the attached fix

Occurs in 2.30.2 (the version of Hamster in Debian Squeeze).

The Activities tab in the Overview shows the wrong time values.  For example, a task from 14:52 - 15:03 is shown as being 10 minutes, instead of 11.  It happens to roughly half the tasks, so I suspected a rounding bug, and found that this patch fixes the issue:

--- stuff.py.orig	2012-05-10 10:48:10.761716704 -0700
+++ stuff.py	2012-05-10 10:56:49.493696613 -0700
@@ -68,7 +68,7 @@
 
 def duration_minutes(duration):
     """returns minutes from duration, otherwise we keep bashing in same math"""
-    return duration.seconds / 60 + duration.days * 24 * 60
+    return (duration.seconds + 30) / 60 + duration.days * 24 * 60
 
 
 def load_ui_file(name):

That file on github (what I believe is the current trunk) is very different, so I can't tell if the bug still exists in newer versions, but there are a couple instances of "seconds/60" in there; if seconds are stored as integers there may still be some related issues.
Comment 1 Toms Bauģis 2012-09-24 19:34:18 UTC
moved: https://github.com/projecthamster/hamster/issues/26