# HG changeset patch # User Sylvain Thénault # Date 1252945482 -7200 # Node ID 07d11bacfefeba2451a4dc2570d3f0978d03c8ad # Parent 44fa8d4a25d5721d82cc653d9e29ad92106a07ad displaytime attribute should not have been removed from there diff -r 44fa8d4a25d5 -r 07d11bacfefe common/uilib.py --- a/common/uilib.py Mon Sep 14 15:11:58 2009 +0200 +++ b/common/uilib.py Mon Sep 14 18:24:42 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') diff -r 44fa8d4a25d5 -r 07d11bacfefe entity.py --- a/entity.py Mon Sep 14 15:11:58 2009 +0200 +++ b/entity.py Mon Sep 14 18:24:42 2009 +0200 @@ -427,7 +427,7 @@ return value def printable_value(self, attr, value=_marker, attrtype=None, - format='text/html'): + format='text/html', displaytime=True): """return a displayable value (i.e. unicode string) which may contains html tags """ @@ -457,7 +457,8 @@ return self.mtc_transform(value.getvalue(), attrformat, format, encoding) return u'' - value = printable_value(self.req, attrtype, value, props) + value = printable_value(self.req, attrtype, value, props, + displaytime=displaytime) if format == 'text/html': value = xml_escape(value) return value