From: Joe Boutros Date: Tue, 10 Apr 2012 06:39:10 +0000 (-0500) Subject: added expects_localtime to the compact_date template filter in the case of Django... X-Git-Tag: 2.0.0~19 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=6b1be47f474be03d411609f7f630f228b81ee70f;p=django-postman.git added expects_localtime to the compact_date template filter in the case of Django > 1.4. --- diff --git a/postman/templatetags/postman_tags.py b/postman/templatetags/postman_tags.py index 7c420dc..be358e4 100644 --- a/postman/templatetags/postman_tags.py +++ b/postman/templatetags/postman_tags.py @@ -38,7 +38,13 @@ def or_me(value, arg): arg = unicode(arg) return _('') if value == arg else value -@register.filter +import django +if django.VERSION >= (1, 4): + date_filter_params = {'expects_localtime':True} +else: + date_filter_params = {} + +@register.filter(**date_filter_params) def compact_date(value, arg): """ Output a date as short as possible.