]> git.openstreetmap.org Git - osqa.git/commitdiff
Fixes a possible date display bug.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 13 Jun 2011 12:58:34 +0000 (12:58 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 13 Jun 2011 12:58:34 +0000 (12:58 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1064 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/templatetags/extra_tags.py

index d38307ea6a3c0d870bb0c20647af5ef1354c8a54..672d7a645b24f1ceb6bbec9d783bc6c3cccbf6a8 100644 (file)
@@ -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: