mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
wrap suspended due date in (), and catch invalid dates
This commit is contained in:
parent
452548a0ef
commit
c2857bbbef
1 changed files with 10 additions and 3 deletions
|
@ -204,7 +204,14 @@ class DataModel(QAbstractTableModel):
|
|||
t += " %d" % (c.ord+1)
|
||||
return t
|
||||
elif type == "cardDue":
|
||||
return self.nextDue(c, index)
|
||||
# catch invalid dates
|
||||
try:
|
||||
t = self.nextDue(c, index)
|
||||
except:
|
||||
t = ""
|
||||
if c.queue < 0:
|
||||
t = "(" + t + ")"
|
||||
return t
|
||||
elif type == "noteCrt":
|
||||
return time.strftime("%Y-%m-%d", time.localtime(c.note().id/1000))
|
||||
elif type == "noteMod":
|
||||
|
@ -268,10 +275,10 @@ class DataModel(QAbstractTableModel):
|
|||
date = c.due
|
||||
elif c.queue == 0 or c.type == 0:
|
||||
return str(c.due)
|
||||
elif c.queue in (2,3) or c.type == 2:
|
||||
elif c.queue in (2,3) or (c.type == 2 and c.queue < 0):
|
||||
date = time.time() + ((c.due - self.col.sched.today)*86400)
|
||||
else:
|
||||
return _("(susp.)")
|
||||
return ""
|
||||
return time.strftime("%Y-%m-%d", time.localtime(date))
|
||||
|
||||
# Line painter
|
||||
|
|
Loading…
Reference in a new issue