hamster-applet r836 - trunk/hamster



Author: tbaugis
Date: Fri Mar  6 08:53:46 2009
New Revision: 836
URL: http://svn.gnome.org/viewvc/hamster-applet?rev=836&view=rev

Log:
get_interval_ids did not return all activities in the interval
because it forgot about Those Spanning Cases.
Patch by Hendrik van Antwerpen

Modified:
   trunk/hamster/db.py

Modified: trunk/hamster/db.py
==============================================================================
--- trunk/hamster/db.py	(original)
+++ trunk/hamster/db.py	Fri Mar  6 08:53:46 2009
@@ -464,12 +464,12 @@
                      FROM activities a
                 LEFT JOIN categories b on b.id = a.category_id
                     WHERE a.id in (SELECT activity_id from facts
-                                  WHERE date(start_time) >= ?
-                                    AND date(start_time) <= ?)
+                                    WHERE (date(start_time) >= ? and date(start_time) <= ?)
+                                       OR (date(end_time) >= ? and date(end_time) <= ?))
         """
         end_date = end_date or date        
 
-        return self.fetchall(query, (_("Unsorted"), date, end_date))
+        return self.fetchall(query, (_("Unsorted"), date, end_date, date, end_date))
         
     
     def __remove_fact(self, fact_id):



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