summaryrefslogtreecommitdiff
path: root/app/lib
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2012-10-14 22:26:39 -0400
committerluxagraf <sng@luxagraf.net>2012-10-14 22:26:39 -0400
commitfa869d1a60ff6f8c41cd7f2bf0e0964bff9ba9f1 (patch)
treef60ab325dbaf6a4dab443daa3f8fea84edba4a1d /app/lib
parent27e05eaae0dd829090749facc5e10ca0a7b9a5dc (diff)
converted publishing system to have buttons int the admin and reworked the config system
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/templatetags/templatetags/html5_datetime.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/lib/templatetags/templatetags/html5_datetime.py b/app/lib/templatetags/templatetags/html5_datetime.py
new file mode 100644
index 0000000..20b5f27
--- /dev/null
+++ b/app/lib/templatetags/templatetags/html5_datetime.py
@@ -0,0 +1,16 @@
+from django.utils import dateformat
+import datetime
+from django import template
+from django.utils.safestring import mark_safe
+register = template.Library()
+
+@register.filter
+def html5_datetime(value):
+ """
+ Adds to colons to django's "Z" format to match html5 guidelines
+ """
+ fmt = "Y-m-d\TH:i:sO"
+ value = value
+ str = dateformat.format(value, fmt)
+ s = str[:-2] + ':' + str[-2:]
+ return mark_safe(s)