hamster-applet r873 - trunk/hamster



Author: tbaugis
Date: Thu Mar 19 19:13:18 2009
New Revision: 873
URL: http://svn.gnome.org/viewvc/hamster-applet?rev=873&view=rev

Log:
silly typo resulted in wrong deltas when start and end dates do 
not match in get_facts

Modified:
   trunk/hamster/db.py

Modified: trunk/hamster/db.py
==============================================================================
--- trunk/hamster/db.py	(original)
+++ trunk/hamster/db.py	Thu Mar 19 19:13:18 2009
@@ -427,15 +427,17 @@
                 res.append(f)
             elif fact_start_date != fact_end_date:
                 # check if maybe we have to split activity in two
-                if date <= f["start_time"].date()  <= end_date:
+                if date <= fact["start_time"].date()  <= end_date:
                     start_fact = copy.copy(f)
-                    start_fact["end_time"] = dt.datetime.combine(end_date, dt.time(0, 0))
+                    start_fact["end_time"] = dt.datetime.combine(f["end_time"],
+                                                                 dt.time(0, 0))
                     start_fact["delta"] = start_fact["end_time"] - start_fact["start_time"]
                     res.append(start_fact)
 
                 if date <= fact["end_time"].date()  <= end_date:
                     end_fact = copy.copy(f)
-                    end_fact["start_time"] = dt.datetime.combine(end_fact["end_time"], dt.time(0, 0))
+                    end_fact["start_time"] = dt.datetime.combine(f["end_time"],
+                                                                 dt.time(0, 0))
                     end_fact["delta"] = end_fact["end_time"] - end_fact["start_time"]
                     res.append(end_fact)
             else:



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