From: Joseph Spiros Date: Thu, 8 Jul 2010 00:32:55 +0000 (-0400) Subject: Merge branch 'master' of git://github.com/kgodey/philo into kgodey X-Git-Tag: philo-0.9~53^2~1 X-Git-Url: http://git.ithinksw.org/philo.git/commitdiff_plain/5a212263dac7562484538d03c418c1878af9d5ca?hp=db0947dc7adfb2361f01e61eb495b1638cbc446b Merge branch 'master' of git://github.com/kgodey/philo into kgodey --- diff --git a/contrib/penfield/templatetags/__init__.py b/contrib/penfield/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/contrib/penfield/templatetags/penfield.py b/contrib/penfield/templatetags/penfield.py new file mode 100644 index 0000000..3f4c2f4 --- /dev/null +++ b/contrib/penfield/templatetags/penfield.py @@ -0,0 +1,23 @@ +from django import template +from django.utils.dates import MONTHS, MONTHS_AP + +register = template.Library() + +def monthname(value): + monthnum = int(value) + if 1 <= monthnum <= 12: + return MONTHS[monthnum] + else: + return value + +register.filter('monthname', monthname) + +def ap_monthname(value): + monthnum = int(value) + if 1 <= monthnum <= 12: + return MONTHS_AP[monthnum] + else: + return value + +register.filter('monthname', monthname) +register.filter('ap_monthname', ap_monthname)