From 84134106cbb84d697fa8a51469429d993ecd5e2b Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 24 Apr 2012 04:35:36 +0900 Subject: [PATCH] derive period in review history graph from revlog, not collection crt --- anki/stats.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/anki/stats.py b/anki/stats.py index 15badbaf6..24cf16ebd 100644 --- a/anki/stats.py +++ b/anki/stats.py @@ -251,7 +251,12 @@ group by day order by day""" % (self._limit(), lim), tot = totd[-1][1] period = self._periodDays() if not period: - period = first + # base off earliest repetition date + t = self.col.db.scalar("select id from revlog limit 1") + if not t: + period = 1 + else: + period = (self.col.sched.dayCutoff - (t/1000)) / 86400 i = [] self._line(i, _("Days studied"), _("%(pct)d%% (%(x)s of %(y)s)") % dict(