common/uilib.py
changeset 3230 1d25e928c299
parent 3185 bd0126d17e83
parent 3212 07d11bacfefe
child 3369 7b88d12b4ee2
--- a/common/uilib.py	Mon Sep 14 11:25:56 2009 +0200
+++ b/common/uilib.py	Tue Sep 15 15:01:41 2009 +0200
@@ -31,7 +31,7 @@
     return 'Any X WHERE X eid %s' % eid
 
 
-def printable_value(req, attrtype, value, props=None):
+def printable_value(req, attrtype, value, props=None, displaytime=True):
     """return a displayable value (i.e. unicode string)"""
     if value is None or attrtype == 'Bytes':
         return u''
@@ -46,7 +46,9 @@
     if attrtype == 'Time':
         return ustrftime(value, req.property_value('ui.time-format'))
     if attrtype == 'Datetime':
-        return ustrftime(value, req.property_value('ui.datetime-format'))
+        if displaytime:
+            return ustrftime(value, req.property_value('ui.datetime-format'))
+        return ustrftime(value, req.property_value('ui.date-format'))
     if attrtype == 'Boolean':
         if value:
             return req._('yes')