--- a/web/facet.py Tue Jun 23 13:55:23 2009 +0200
+++ b/web/facet.py Tue Jun 23 15:52:52 2009 +0200
@@ -10,7 +10,7 @@
from itertools import chain
from copy import deepcopy
-from datetime import date
+from datetime import date, datetime
from logilab.mtconverter import html_escape
@@ -683,8 +683,15 @@
class DateFacetRangeWidget(FacetRangeWidget):
+
formatter = 'function (value) {return (new Date(parseFloat(value))).strftime(DATE_FMT);}'
+
+ def round_max_value(self, d):
+ 'round to upper value to avoid filtering out the max value'
+ return datetime(d.year, d.month, d.day + 1)
+
def __init__(self, facet, minvalue, maxvalue):
+ maxvalue = self.round_max_value(maxvalue)
super(DateFacetRangeWidget, self).__init__(facet,
datetime2ticks(minvalue),
datetime2ticks(maxvalue))
--- a/web/views/formrenderers.py Tue Jun 23 13:55:23 2009 +0200
+++ b/web/views/formrenderers.py Tue Jun 23 15:52:52 2009 +0200
@@ -206,6 +206,8 @@
w(u'</table>')
def render_buttons(self, w, form):
+ if not form.form_buttons:
+ return
w(u'<table class="%s">\n<tr>\n' % self.button_bar_class)
for button in form.form_buttons:
w(u'<td>%s</td>\n' % button.render(form))