mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
days since creation needs to be calculated relative to rollover
https://anki.tenderapp.com/discussions/ankidesktop/29502-next-day-starts-experimental-v2-scheduler-bug
This commit is contained in:
parent
504ee75c8e
commit
ee5675ef5b
1 changed files with 7 additions and 1 deletions
|
@ -1196,7 +1196,7 @@ where id = ?
|
|||
def _updateCutoff(self):
|
||||
oldToday = self.today
|
||||
# days since col created
|
||||
self.today = int((time.time() - self.col.crt) // 86400)
|
||||
self.today = self._daysSinceCreation()
|
||||
# end of day cutoff
|
||||
self.dayCutoff = self._dayCutoff()
|
||||
if oldToday != self.today:
|
||||
|
@ -1233,6 +1233,12 @@ where id = ?
|
|||
stamp = time.mktime(date.timetuple())
|
||||
return stamp
|
||||
|
||||
def _daysSinceCreation(self):
|
||||
startDate = datetime.datetime.fromtimestamp(self.col.crt)
|
||||
startDate = startDate.replace(hour=self.col.conf.get("rollover", 4),
|
||||
minute=0, second=0, microsecond=0)
|
||||
return (time.time() - time.mktime(startDate.timetuple())) // 86400
|
||||
|
||||
# Deck finished state
|
||||
##########################################################################
|
||||
|
||||
|
|
Loading…
Reference in a new issue