summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-05-14 20:36:50 -0400
committerrsiddharth <s@ricketyspace.net>2019-05-14 20:36:50 -0400
commit2287d4bcf51da75f74f89306e09ee1b79e518e98 (patch)
tree67a1ed5aad51e928a74a949088817b4f1b8a8952 /bin
parent42fae219fc43e516d7f443152038cdf70abd9790 (diff)
bin/news: Add datefmt.
* bin/news (datefmt): New function.
Diffstat (limited to 'bin')
-rw-r--r--bin/news5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/news b/bin/news
index 5c4c2bb..09a57f8 100644
--- a/bin/news
+++ b/bin/news
@@ -5,6 +5,7 @@
# Copyright © 2019 Free Software Foundation of India.
#
+import datetime
import os
import re
import sys
@@ -73,6 +74,10 @@ def template(type):
return read('templates/{}.html'.format(type))
+def datefmt(d):
+ return datetime.datetime.strptime(d, '%Y%m%d').strftime('%B %d, %Y')
+
+
def process(f):
c = read(f.path)