Ticket #1163 (closed defect: fixed)

Opened 14 years ago

Last modified 14 years ago

eventdisplay cannot cope when to_hour is 24

Reported by: Brian Sutherland <jinty@…> Owned by: lregebro
Priority: P1 Milestone: unspecified
Component: CalZope Version: TRUNK
Severity: normal Keywords:
Cc:

Description

if I set to_hour in a calendar view to 24, I get this traceback when looking at the calendar:

    *  Module zope.interface.adapter, line 485, in queryMultiAdapter
    * Module Products.CalZope.browser.eventdisplay, line 125, in __init__

TypeError: combine() argument 2 must be datetime.time, not datetime.timedelta

This patch fixed the issue for me:

Index: ../CalZope/browser/eventdisplay.py
===================================================================
--- ../CalZope/browser/eventdisplay.py  (revision 29883)
+++ ../CalZope/browser/eventdisplay.py  (working copy)
@@ -122,7 +122,7 @@
         if view.to_hour != 24:
             day_ends = datetime.combine(event_begins.date(), time(view.to_hour + 1))
         else:
-            day_ends = datetime.combine(event_begins.date(), timedelta(1))
+            day_ends = datetime.combine(event_begins.date(), time(1))

         start_delta = event_begins - day_begins
         if start_delta < timedelta(0):

Change History

comment:1 Changed 14 years ago by lregebro

  • Status changed from new to closed
  • Resolution set to fixed

Solved in [31151].

Note: See TracTickets for help on using tickets.