summaryrefslogtreecommitdiff
path: root/helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'helpers.py')
-rw-r--r--helpers.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/helpers.py b/helpers.py
index a746ea2..a6c4de2 100644
--- a/helpers.py
+++ b/helpers.py
@@ -145,3 +145,15 @@ def touchup_plaintext(plaintext):
for regexp, repl in _TOUCHUPS:
text = regexp.sub(repl, text)
return text
+
+
+DATE_FORMATTERS = {
+ 'en': {
+ 'date': lambda d: d.strftime('%A %B %-d, %Y'),
+ 'time': lambda d: d.strftime('%I:%M %P'),
+ },
+ 'fr': {
+ 'date': lambda d: d.strftime('%A %-d %B %Y').capitalize(),
+ 'time': lambda d: d.strftime('%Hh%M'),
+ },
+}