From fa869d1a60ff6f8c41cd7f2bf0e0964bff9ba9f1 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sun, 14 Oct 2012 22:26:39 -0400 Subject: converted publishing system to have buttons int the admin and reworked the config system --- app/lib/templatetags/templatetags/html5_datetime.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 app/lib/templatetags/templatetags/html5_datetime.py (limited to 'app/lib') 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) -- cgit v1.2.3-70-g09d2