From: hernani Date: Sat, 12 Jun 2010 02:14:03 +0000 (+0000) Subject: Show time diffs in seconds to. X-Git-Tag: live~719 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/de392033a9d84b80481332d97f689b2f7f0ab318 Show time diffs in seconds to. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@413 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/templatetags/extra_tags.py b/forum/templatetags/extra_tags.py index 92cb4db..892f38b 100644 --- a/forum/templatetags/extra_tags.py +++ b/forum/templatetags/extra_tags.py @@ -167,8 +167,10 @@ def diff_date(date, limen=2): return _('yesterday') elif minutes >= 60: return ungettext('%(hr)d hour ago', '%(hr)d hours ago', hours) % {'hr':hours} - else: + elif diff.seconds >= 60: return ungettext('%(min)d min ago', '%(min)d mins ago', minutes) % {'min':minutes} + else: + return ungettext('%(sec)d sec ago', '%(sec)d secs ago', diff.seconds) % {'sec':diff.seconds} @register.simple_tag def media(url):