[PATCH coffee-flask] Fix data acquisition for flavor graph.

Function 'coffee_flavors' wasn't doing what it was supposed to do. Upper bound was shifted by a day (so for a week graph it was count- ing 8 days) and also it didn't take into account 'start' variable. --- Oprava bugu, ktery spatne pocital kolacovy graf na uvodni obrazovce. coffee_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coffee_db.py b/coffee_db.py index 8653f98..7e28f92 100644 --- a/coffee_db.py +++ b/coffee_db.py @@ -77,7 +77,7 @@ def coffee_flavors(uid=None, days=0, start=0): variables = list() if days is not None and days != 0: - query += " where date(time) between date('now', 'localtime', '-"+ str(days) +" days') and date('now', 'localtime', '-"+ str(start) +" days')" + query += " where date(time) between date('now', 'localtime', '-"+ str(days+start-1) +" days') and date('now', 'localtime', '-"+ str(start) +" days')" if uid is not None: query += " and id = ?" -- 2.7.4
participants (1)
-
Jaroslav Klapalek