]> git.openstreetmap.org Git - osqa.git/commitdiff
Better fix that the last one.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 13 Jun 2011 13:04:21 +0000 (13:04 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 13 Jun 2011 13:04:21 +0000 (13:04 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1065 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/templatetags/extra_tags.py

index 672d7a645b24f1ceb6bbec9d783bc6c3cccbf6a8..6e5d6e64abc87c79b7f96a4efb89770354f80de6 100644 (file)
@@ -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')