src/ztfy/utils/date.py
branchZTK-1.1
changeset 287 e72a0ac7b1b9
parent 284 90f42ae4f155
--- a/src/ztfy/utils/date.py	Wed Jan 24 13:56:03 2024 +0100
+++ b/src/ztfy/utils/date.py	Wed Jan 24 14:41:56 2024 +0100
@@ -32,6 +32,22 @@
 from ztfy.utils import _
 
 
+MONTHS = {
+     1: _("january"),
+     2: _("february"),
+     3: _("march"),
+     4: _("april"),
+     5: _("may"),
+     6: _("june"),
+     7: _("july"),
+     8: _("august"),
+     9: _("september"),
+    10: _("october"),
+    11: _("november"),
+    12: _("december")
+}
+
+
 def unidate(value):
     """Get specified date converted to unicode ISO format
     
@@ -93,6 +109,7 @@
                                  translate(format, context=request).encode('utf-8')).decode('utf-8')
     else:
         return format.replace('%d', str(value.day)) \
+                     .replace('%B', translate(MONTHS[value.month])) \
                      .replace('%m', str(value.month)) \
                      .replace('%Y', str(value.year))