Added new date and datetime display formats ZTK-1.1
authorThierry Florac <thierry.florac@onf.fr>
Tue, 03 Dec 2013 11:43:33 +0100
branchZTK-1.1
changeset 237 fca4a296d89e
parent 236 3c96476b16f9
child 238 26773e68d3d3
Added new date and datetime display formats
src/ztfy/utils/date.py
--- a/src/ztfy/utils/date.py	Wed Nov 20 08:46:18 2013 +0100
+++ b/src/ztfy/utils/date.py	Tue Dec 03 11:43:33 2013 +0100
@@ -76,14 +76,19 @@
     return datetime(value.year, value.month, value.day)
 
 
+SH_DATE_FORMAT = _("%d/%m/%Y")
+SH_DATETIME_FORMAT = _("%d/%m/%Y - %H:%M")
+
 EXT_DATE_FORMAT = _("on %d/%m/%Y")
 EXT_DATETIME_FORMAT = _("on %d/%m/%Y at %H:%M")
 
+
 def formatDate(value, format=EXT_DATE_FORMAT, request=None):
     if request is None:
         request = queryRequest()
     return datetime.strftime(tztime(value), translate(format, context=request).encode('utf-8')).decode('utf-8')
 
+
 def formatDatetime(value, format=EXT_DATETIME_FORMAT, request=None):
     return formatDate(value, format, request)