web/views/navigation.py
changeset 8015 b9de628f90e6
parent 8009 75638a6ff159
child 8054 11b6589352b6
--- a/web/views/navigation.py	Mon Oct 24 13:51:39 2011 +0200
+++ b/web/views/navigation.py	Mon Oct 24 13:52:24 2011 +0200
@@ -20,6 +20,8 @@
 __docformat__ = "restructuredtext en"
 _ = unicode
 
+from datetime import datetime
+
 from rql.nodes import VariableRef, Constant
 
 from logilab.mtconverter import xml_escape
@@ -151,6 +153,10 @@
                 col = var.selected_index()
                 attrname = None
             if col is not None:
+                # if column type is date[time], set proper 'nb_chars'
+                if var.stinfo['possibletypes'] & frozenset(('TZDatetime', 'Datetime',
+                                                            'Date')):
+                    self.nb_chars = len(self._cw.format_date(datetime.today()))
                 index_display = self.display_func(rset, col, attrname)
                 break
         else: