From de392033a9d84b80481332d97f689b2f7f0ab318 Mon Sep 17 00:00:00 2001 From: hernani Date: Sat, 12 Jun 2010 02:14:03 +0000 Subject: [PATCH] Show time diffs in seconds to. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@413 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/templatetags/extra_tags.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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): -- 2.39.5