Download:
child 132:3cfe292cacf3
parent 130:7a9e1f1ae89f
131:0cb14e3f792e
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.

2 файлов изменено, 4 вставок(+), 3 удалений(-) [+]
candolint/uimodules.py file | annotate | diff | comparison | revisions
templates/ui/time.html file | annotate | diff | comparison | revisions
--- a/candolint/uimodules.py Fri Jul 08 00:31:50 2016 +0800
+++ b/candolint/uimodules.py Fri Jul 08 22:11:17 2016 +0800
@@ -7,9 +7,10 @@
datetime = value.isoformat() + 'Z'
text = value.strftime('%Y-%m-%d %H:%M:%S') + ' UTC'
else:
- datetime = value
+ parts = value.split(' ', 2)
+ datetime = '{}T{}{}'.format(*parts)
text = value
- return self.render_string('ui/time.html', datetime=datetime, title=text, text=text)
+ return self.render_string('ui/time.html', datetime=datetime, text=text)
class Badges(UIModule):
--- 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
@@ -1,1 +1,1 @@
-<time datetime="{{ datetime }}" title="{{ title }}">{{ text }}</time>
+<time datetime="{{ datetime }}" title="{{ text }}">{{ text }}</time>