From 0b24e56b403a51a3835006f16d743d604116e339 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 6 May 2012 17:02:09 +0900 Subject: [PATCH] hourly graph now honours period setting --- anki/stats.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/anki/stats.py b/anki/stats.py index 77c87d93c..f5c9afcc0 100644 --- a/anki/stats.py +++ b/anki/stats.py @@ -533,6 +533,9 @@ order by thetype, ease""" % lim) if lim: lim = " and " + lim sd = datetime.datetime.fromtimestamp(self.col.crt) + pd = self._periodDays() + if pd: + lim += " and id > %d" % ((self.col.sched.dayCutoff-(86400*pd))*1000) return self.col.db.all(""" select 23 - ((cast((:cut - id/1000) / 3600.0 as int)) %% 24) as hour,