From: Johannes R. <svn...@pl...> - 2012-11-29 23:08:44
|
Repository: plone.app.event Branch: refs/heads/master Date: 2012-11-29T13:59:45-08:00 Author: Johannes Raggam (thet) <rag...@ad...> Commit: https://github.com/plone/plone.app.event/commit/37b0b476422965c2cd7e4d0be321b42d9c9e4b55 use dt_start_of_day and dt_end_of_day functions to for searching one whole day Files changed: M plone/app/event/dx/behaviors.py diff --git a/plone/app/event/dx/behaviors.py b/plone/app/event/dx/behaviors.py index 3e563d7..fc7f349 100644 --- a/plone/app/event/dx/behaviors.py +++ b/plone/app/event/dx/behaviors.py @@ -8,7 +8,7 @@ from plone.app.textfield.value import RichTextValue from plone.directives import form from plone.event.interfaces import IEventAccessor -from plone.event.utils import tzdel, utc, utctz, dt_to_zone +from plone.event.utils import tzdel, utc, dt_to_zone from plone.formwidget.recurrence.z3cform.widget import RecurrenceWidget, ParameterizedWidgetFactory from plone.indexer import indexer from plone.uuid.interfaces import IUUID @@ -21,8 +21,11 @@ from zope.interface import invariant, Invalid from plone.app.event import messageFactory as _ -from plone.app.event.base import default_timezone, default_end_dt +from plone.app.event.base import default_timezone +from plone.app.event.base import default_end_dt from plone.app.event.base import localized_now, DT +from plone.app.event.base import dt_start_of_day +from plone.app.event.base import dt_end_of_day from plone.app.event.dx.interfaces import IDXEvent @@ -301,8 +304,8 @@ def _fix_zone(dt, zone): # Adapt for whole day if behavior.whole_day: - start = start.replace(hour=0,minute=0,second=0) - end = end.replace(hour=23,minute=59,second=59) + start = dt_start_of_day(start) + end = dt_end_of_day(end) # Save back obj.start = utc(start) |