mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
properly set midnight offset, fix graph offset
This commit is contained in:
parent
3afcf982dd
commit
89591073de
1 changed files with 3 additions and 3 deletions
|
@ -48,9 +48,10 @@ class DeckGraphs(object):
|
||||||
months = {}
|
months = {}
|
||||||
next = {}
|
next = {}
|
||||||
lowestInDay = 0
|
lowestInDay = 0
|
||||||
|
midnightOffset = time.timezone - self.deck.utcOffset
|
||||||
now = list(time.localtime(time.time()))
|
now = list(time.localtime(time.time()))
|
||||||
now[3] = 23; now[4] = 59
|
now[3] = 23; now[4] = 59
|
||||||
self.endOfDay = time.mktime(now) + self.deck.utcOffset
|
self.endOfDay = time.mktime(now) - midnightOffset
|
||||||
t = time.time()
|
t = time.time()
|
||||||
young = self.deck.s.all("""
|
young = self.deck.s.all("""
|
||||||
select interval, combinedDue
|
select interval, combinedDue
|
||||||
|
@ -65,8 +66,7 @@ from cards where type = 1 and priority in (1,2,3,4) and interval > 21""")
|
||||||
for (interval, due) in src:
|
for (interval, due) in src:
|
||||||
day=int(round(interval))
|
day=int(round(interval))
|
||||||
days[day] = days.get(day, 0) + 1
|
days[day] = days.get(day, 0) + 1
|
||||||
indays = int((due - self.endOfDay)
|
indays = int(((due - self.endOfDay) / 86400.0) + 1)
|
||||||
/ 86400.0)
|
|
||||||
next[indays] = next.get(indays, 0) + 1 # type-agnostic stats
|
next[indays] = next.get(indays, 0) + 1 # type-agnostic stats
|
||||||
dest[indays] = dest.get(indays, 0) + 1 # type-specific stats
|
dest[indays] = dest.get(indays, 0) + 1 # type-specific stats
|
||||||
if indays < lowestInDay:
|
if indays < lowestInDay:
|
||||||
|
|
Loading…
Reference in a new issue