From 2bf96b9c3daa58aa1cb76a184926df789165b0ee Mon Sep 17 00:00:00 2001 From: hernani Date: Mon, 13 Jun 2011 12:58:34 +0000 Subject: [PATCH] Fixes a possible date display bug. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1064 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/templatetags/extra_tags.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/forum/templatetags/extra_tags.py b/forum/templatetags/extra_tags.py index d38307e..672d7a6 100644 --- a/forum/templatetags/extra_tags.py +++ b/forum/templatetags/extra_tags.py @@ -136,11 +136,12 @@ def diff_date(date, limen=2): now = datetime.datetime.now() diff = now - date + years = diff.years days = diff.days hours = int(diff.seconds/3600) minutes = int(diff.seconds/60) - if days > 2: + if years > 0 or days > 2: if date.year == now.year: return dateformat.format(date, 'd M, H:i') else: -- 2.39.5