diff --git a/mitterlib/ui/helpers/timesince.py b/mitterlib/ui/helpers/timesince.py index da9c1db..5d88d74 100644 --- a/mitterlib/ui/helpers/timesince.py +++ b/mitterlib/ui/helpers/timesince.py @@ -58,7 +58,7 @@ def timesince(d, now=None): # ignore microsecond part of 'd' since we removed it from 'now' delta = now - (d - datetime.timedelta(0, 0, d.microsecond)) since = delta.days * 24 * 60 * 60 + delta.seconds - if since <= 0: + if int(since) <= 0: return 'moments' for i, (seconds, name) in enumerate(chunks): @@ -66,9 +66,6 @@ def timesince(d, now=None): if count != 0: break - if count < 0: - return '%d milliseconds' % math.floor((now - d).microseconds / 1000) - s = '%d %s' % (count, name(count)) if i + 1 < len(chunks): # Now get the second item