mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 08:22:24 -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
|
||||
|
||||
def getDaysReviewed(self, start, finish):
|
||||
now = datetime.datetime.today()
|
||||
x = now + datetime.timedelta(start)
|
||||
y = now + datetime.timedelta(finish)
|
||||
return self.deck.s.scalar(
|
||||
"select count() from stats where "
|
||||
"day >= :x and day <= :y and reps > 0",
|
||||
x=x, y=y)
|
||||
today = self.deck.failedCutoff
|
||||
x = today + 86400*start
|
||||
y = today + 86400*finish
|
||||
return self.deck.s.scalar("""
|
||||
select count(distinct(cast((time-:off)/86400 as integer))) from reviewHistory
|
||||
where time >= :x and time <= :y""",x=x,y=y, off=-self.deck.utcOffset)
|
||||
|
||||
def getRepsDone(self, start, finish):
|
||||
now = datetime.datetime.today()
|
||||
|
|
Loading…
Reference in a new issue