Commits

David Chambers  committed 5bd1c9c

Rewrote `month` filter.

  • Participants
  • Parent commits 5a63d85

Comments (0)

Files changed (1)

File templatetags/mango_extras.py

 
 @register.filter
 def month(n):
-    if 1 <= n <= 12:
-        return [
-            'January',
-            'February',
-            'March',
-            'April',
-            'May',
-            'June',
-            'July',
-            'August',
-            'September',
-            'October',
-            'November',
-            'December',
-        ][n - 1]
+    return datetime.datetime.today().replace(month=n).strftime('%B')
 
 @register.filter
 @stringfilter