[hamster-applet] truncating fact date for the 'date' field and fixed math in delta



commit 3d2f5801cd8dd1d3ef2c7ff42801806c53163805
Author: Toms Bauģis <toms baugis gmail com>
Date:   Wed Apr 14 08:52:14 2010 +0100

    truncating fact date for the 'date' field and fixed math in delta

 src/hamster/client.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/hamster/client.py b/src/hamster/client.py
index 365efd6..386f3fd 100644
--- a/src/hamster/client.py
+++ b/src/hamster/client.py
@@ -51,9 +51,9 @@ def from_dbus_fact(fact):
                 activity_id = fact[5],
                 category = fact[6],
                 tags = fact[7],
-                date = dt.datetime.utcfromtimestamp(fact[8]),
-                delta = dt.timedelta(days = fact[9] // 24 * 60 * 60,
-                                     seconds = fact[9] % 24 * 60 * 60)
+                date = dt.datetime.utcfromtimestamp(fact[8]).date(),
+                delta = dt.timedelta(days = fact[9] // (24 * 60 * 60),
+                                     seconds = fact[9] % (24 * 60 * 60))
                )
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]