Anton Shestakov <av6@dwimlabs.net>, Fri, 08 Jul 2016 22:11:17 +0800
viewer: transform time string from loose ISO 8601 to RFC 3339
This hack is possible because the format of commit date given by SCM is known.
--- a/candolint/uimodules.py Fri Jul 08 00:31:50 2016 +0800
+++ b/candolint/uimodules.py Fri Jul 08 22:11:17 2016 +0800
datetime = value.isoformat() + 'Z'
text = value.strftime('%Y-%m-%d %H:%M:%S') + ' UTC'
+ parts = value.split(' ', 2)
+ datetime = '{}T{}{}'.format(*parts)
- return self.render_string('ui/time.html', datetime=datetime, title=text, text=text)
+ return self.render_string('ui/time.html', datetime=datetime, text=text)
--- a/templates/ui/time.html Fri Jul 08 00:31:50 2016 +0800
+++ b/templates/ui/time.html Fri Jul 08 22:11:17 2016 +0800
-<time datetime="{{ datetime }}" title="{{ title }}">{{ text }}</time>
+<time datetime="{{ datetime }}" title="{{ text }}">{{ text }}</time>