only set lastDue if card is not new, hide due for new cards in stats

This commit is contained in:
Damien Elmes 2009-06-19 07:46:26 +09:00
parent a1981cf220
commit 3e2c150b17
2 changed files with 10 additions and 7 deletions

View file

@ -348,7 +348,9 @@ where factId in (select factId from %s limit 60))""" % (new, new))
if lastDelay >= 0:
# keep last interval if reviewing early
card.lastInterval = last
card.lastDue = card.due
if card.reps:
# only update if card was not new
card.lastDue = card.due
card.due = self.nextDue(card, ease, oldState)
card.isDue = 0
card.lastFactor = card.factor

View file

@ -265,12 +265,13 @@ class CardStats(object):
if c.firstAnswered:
self.addLine(_("First Review"), self.strTime(c.firstAnswered))
self.addLine(_("Changed"), self.strTime(c.modified))
next = time.time() - c.due
if next > 0:
next = _("%s ago") % fmt(next)
else:
next = _("in %s") % fmt(abs(next))
self.addLine(_("Due"), next)
if c.reps:
next = time.time() - c.due
if next > 0:
next = _("%s ago") % fmt(next)
else:
next = _("in %s") % fmt(abs(next))
self.addLine(_("Due"), next)
self.addLine(_("Interval"), fmt(c.interval * 86400))
self.addLine(_("Ease"), fmtFloat(c.factor, point=2))
if c.lastDue: