# HG changeset patch # User Adrien Di Mascio # Date 1245765172 -7200 # Node ID d653e4c944d7f7eb8d1d29cc5a9adca64f4aac53 # Parent 746c5e6acd389c102caa7066beaae01985b9c9e8# Parent 6a631ec5cc71032bf457c5424d587bd0600db179 merge diff -r 746c5e6acd38 -r d653e4c944d7 web/facet.py --- 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)) diff -r 746c5e6acd38 -r d653e4c944d7 web/views/formrenderers.py --- 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'') def render_buttons(self, w, form): + if not form.form_buttons: + return w(u'\n\n' % self.button_bar_class) for button in form.form_buttons: w(u'\n' % button.render(form))
%s