[hamster-applet] no end time in other days counts as no duration; don't run too far after next activity when trying t



commit ebd7d93393fe2041c682e09557b0e94409436c82
Author: Toms Bauģis <toms baugis gmail com>
Date:   Sat Dec 26 04:04:30 2009 +0000

    no end time in other days counts as no duration; don't run too far after next activity when trying to squeeze in.

 hamster/db.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/hamster/db.py b/hamster/db.py
index 2f8ba77..ede7b75 100644
--- a/hamster/db.py
+++ b/hamster/db.py
@@ -370,7 +370,7 @@ class Storage(storage.Storage):
         fact = self.fetchone(query, (start_time,
                                      start_time,
                                      start_time,
-                                     start_time + dt.timedelta(days=2)))
+                                     start_time + dt.timedelta(seconds = 60 * 60 * 12)))
 
         end_time = None        
 
@@ -635,7 +635,7 @@ class Storage(storage.Storage):
             elif (dt.date.today() - fact["start_time"].date()) <= dt.timedelta(days=1):
                 fact_end_time = dt.datetime.now().replace(microsecond = 0)
             else:
-                fact_end_time = fact["start_time"].replace(hour=23, minute=59)
+                fact_end_time = fact["start_time"]
 
             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]