mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -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 = {}
|
||||
next = {}
|
||||
lowestInDay = 0
|
||||
midnightOffset = time.timezone - self.deck.utcOffset
|
||||
now = list(time.localtime(time.time()))
|
||||
now[3] = 23; now[4] = 59
|
||||
self.endOfDay = time.mktime(now) + self.deck.utcOffset
|
||||
self.endOfDay = time.mktime(now) - midnightOffset
|
||||
t = time.time()
|
||||
young = self.deck.s.all("""
|
||||
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:
|
||||
day=int(round(interval))
|
||||
days[day] = days.get(day, 0) + 1
|
||||
indays = int((due - self.endOfDay)
|
||||
/ 86400.0)
|
||||
indays = int(((due - self.endOfDay) / 86400.0) + 1)
|
||||
next[indays] = next.get(indays, 0) + 1 # type-agnostic stats
|
||||
dest[indays] = dest.get(indays, 0) + 1 # type-specific stats
|
||||
if indays < lowestInDay:
|
||||
|
|
Loading…
Reference in a new issue