[datetime] by default display 'UTC' string when displaying TZDatetime
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Mon, 06 Jun 2011 19:54:37 +0200
changeset 7464 9f116f9b3be8
parent 7463 a7daba4046db
child 7466 395c966a1cb3
[datetime] by default display 'UTC' string when displaying TZDatetime
uilib.py
--- a/uilib.py	Mon Jun 06 17:44:43 2011 +0200
+++ b/uilib.py	Mon Jun 06 19:54:37 2011 +0200
@@ -62,12 +62,18 @@
         return value
     if attrtype == 'Date':
         return ustrftime(value, req.property_value('ui.date-format'))
-    if attrtype in ('Time', 'TZTime'):
+    if attrtype == 'Time':
         return ustrftime(value, req.property_value('ui.time-format'))
-    if attrtype in ('Datetime', 'TZDatetime'):
+    if attrtype == 'TZTime':
+        return ustrftime(value, req.property_value('ui.time-format')) + u' UTC'
+    if attrtype == 'Datetime':
         if displaytime:
             return ustrftime(value, req.property_value('ui.datetime-format'))
         return ustrftime(value, req.property_value('ui.date-format'))
+    if attrtype == 'TZDatetime':
+        if displaytime:
+            return ustrftime(value, req.property_value('ui.datetime-format')) + u' UTC'
+        return ustrftime(value, req.property_value('ui.date-format'))
     if attrtype == 'Boolean':
         if value:
             return req._('yes')