[hamster-applet] Fix regression introduced by human days
- From: Patryk Zawadzki <pzawadzki src gnome org>
- To: svn-commits-list gnome org
- Subject: [hamster-applet] Fix regression introduced by human days
- Date: Wed, 3 Jun 2009 06:57:59 -0400 (EDT)
commit 737a2bb1f630af67f89a76b4599f7f7fd39445cd
Author: Patryk Zawadzki <patrys pld-linux org>
Date: Wed Jun 3 12:57:14 2009 +0200
Fix regression introduced by human days
---
hamster/applet.py | 2 +-
hamster/db.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hamster/applet.py b/hamster/applet.py
index d312508..231aae1 100755
--- a/hamster/applet.py
+++ b/hamster/applet.py
@@ -594,7 +594,7 @@ Now, start tracking!
duration = None
if fact["delta"]:
- duration = 24 * fact["delta"].days + fact["delta"].seconds / 60
+ duration = 24 * 60 * fact["delta"].days + fact["delta"].seconds / 60
fact_category = fact['category']
diff --git a/hamster/db.py b/hamster/db.py
index 8f893cb..51c647d 100644
--- a/hamster/db.py
+++ b/hamster/db.py
@@ -356,7 +356,7 @@ class Storage(hamster.storage.Storage):
FROM facts a
LEFT JOIN activities b ON a.activity_id = b.id
LEFT JOIN categories c ON b.category_id = c.id
- WHERE a.end_time >= ? AND a.start_time <= ?
+ WHERE (a.end_time >= ? OR a.end_time IS NULL) AND a.start_time <= ?
ORDER BY a.start_time
"""
end_date = end_date or date
@@ -384,7 +384,7 @@ class Storage(hamster.storage.Storage):
if fact["end_time"]:
fact_end_time = fact["end_time"]
else:
- fact_end_date = now
+ fact_end_time = now
fact_start_date = fact["start_time"].date() \
- dt.timedelta(1 if fact["start_time"].time() < split_time else 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]