mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 16:26:40 -04:00
calculate # days studied using rev log instead
This commit is contained in:
parent
9421a037f6
commit
77029c4ee6
1 changed files with 6 additions and 7 deletions
|
@ -467,13 +467,12 @@ class DeckStats(object):
|
||||||
return html
|
return html
|
||||||
|
|
||||||
def getDaysReviewed(self, start, finish):
|
def getDaysReviewed(self, start, finish):
|
||||||
now = datetime.datetime.today()
|
today = self.deck.failedCutoff
|
||||||
x = now + datetime.timedelta(start)
|
x = today + 86400*start
|
||||||
y = now + datetime.timedelta(finish)
|
y = today + 86400*finish
|
||||||
return self.deck.s.scalar(
|
return self.deck.s.scalar("""
|
||||||
"select count() from stats where "
|
select count(distinct(cast((time-:off)/86400 as integer))) from reviewHistory
|
||||||
"day >= :x and day <= :y and reps > 0",
|
where time >= :x and time <= :y""",x=x,y=y, off=-self.deck.utcOffset)
|
||||||
x=x, y=y)
|
|
||||||
|
|
||||||
def getRepsDone(self, start, finish):
|
def getRepsDone(self, start, finish):
|
||||||
now = datetime.datetime.today()
|
now = datetime.datetime.today()
|
||||||
|
|
Loading…
Reference in a new issue