From 97608dd809af7e98fbbd2810775f1647abeba6e7 Mon Sep 17 00:00:00 2001 From: hernani Date: Mon, 13 Jun 2011 13:04:21 +0000 Subject: [PATCH] Better fix that the last one. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1065 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/templatetags/extra_tags.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/forum/templatetags/extra_tags.py b/forum/templatetags/extra_tags.py index 672d7a6..6e5d6e6 100644 --- a/forum/templatetags/extra_tags.py +++ b/forum/templatetags/extra_tags.py @@ -141,11 +141,10 @@ def diff_date(date, limen=2): hours = int(diff.seconds/3600) minutes = int(diff.seconds/60) - if years > 0 or days > 2: - if date.year == now.year: - return dateformat.format(date, 'd M, H:i') - else: - return dateformat.format(date, 'd M \'y, H:i') + if date.year != now.year: + return dateformat.format(date, 'd M \'y, H:i') + elif days > 2: + return dateformat.format(date, 'd M, H:i') elif days == 2: return _('2 days ago') -- 2.39.5