]> git.openstreetmap.org Git - osqa.git/commitdiff
OSQA-160, now instead of using the Python date library strftime function we use the...
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 11 Apr 2011 18:43:15 +0000 (18:43 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 11 Apr 2011 18:43:15 +0000 (18:43 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@971 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/templatetags/extra_tags.py

index 04b260feed56cfca22ecb9c66be262748df4097f..b9e95eb004dc8f61457d3aa9a13e6de39cdc7b5c 100644 (file)
@@ -9,6 +9,7 @@ import random
 from django import template
 from django.utils.encoding import smart_unicode
 from django.utils.safestring import mark_safe
+from django.utils import dateformat
 from forum.models import Question, Answer, QuestionRevision, AnswerRevision, NodeRevision
 from django.utils.translation import ugettext as _
 from django.utils.translation import ungettext
@@ -141,9 +142,10 @@ def diff_date(date, limen=2):
 
     if days > 2:
         if date.year == now.year:
-            return date.strftime(_("%b %d at %H:%M").encode())
+            return dateformat.format(date, 'd M, H:i')
         else:
-            return date.strftime(_("%b %d '%y at %H:%M").encode())
+            return dateformat.format(date, 'd M \'y, H:i')
+
     elif days == 2:
         return _('2 days ago')
     elif days == 1: