logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

CVS: CMF/CMFCalendar - CalendarTool.py:1.8.10.1: msg#00047

Subject: CVS: CMF/CMFCalendar - CalendarTool.py:1.8.10.1
Update of /cvs-repository/CMF/CMFCalendar
In directory cvs.zope.org:/tmp/cvs-serv11675/CMFCalendar

Modified Files:
      Tag: CMF-1_4-branch
        CalendarTool.py 
Log Message:
Patch by Helge Tesdal. Instead of checking for events with startdate within the 
month, and doing one more query checking for end dates within the month, I 
check for overlap, that is events that starts before the last date of the month 
and ends after the first day of the month. It solves the bug where events 
spanning three months or more would only show up in the start and end month.



=== CMF/CMFCalendar/CalendarTool.py 1.8 => 1.8.10.1 ===
--- CMF/CMFCalendar/CalendarTool.py:1.8 Thu Feb 13 03:35:28 2003
+++ CMF/CMFCalendar/CalendarTool.py     Fri May 23 13:32:07 2003
@@ -129,27 +129,16 @@
         last_day=calendar.monthrange(year, month)[1]
         ## This line was cropping the last day of the month out of the
         ## calendar when doing the query
-       ## last_date=DateTime(str(month)+'/'+str(last_day)+'/'+str(year))
-       last_date=first_date + last_day    
+       ## last_date=DateTime(str(month)+'/'+str(last_day)+'/'+str(year))
+       last_date=first_date + last_day    
         
-       query=self.portal_catalog(portal_type=self.calendar_types,
+       query=self.portal_catalog(portal_type=self.calendar_types,
                                   review_state='published',                    
          
-                                  start=(first_date, last_date),
-                                  start_usage='range:min:max',
+                                  start=last_date,
+                                  start_usage='range:max',
+                                  end=first_date,
+                                  end_usage='range:min',
                                   sort_on='start')
-        # I don't like doing two searches
-        # What i want to do is
-        # start date => 1/1/2002 and start date <= 31/1/2002
-        # or
-        # end date => 1/1/2002 and end date <= 31/1/2002
-        # but I don't know how to do that in one search query :(  - AD
-
-        # if you look at calendar_slot you can see how to do this in 1 query - 
runyaga
-        query+=self.portal_catalog(portal_type=self.calendar_types,
-                                   review_state='published',
-                                   end=(first_date, last_date),
-                                   end_usage='range:min:max',
-                                   sort_on='end')
         
         # compile a list of the days that have events
         eventDays={}





<Prev in Thread] Current Thread [Next in Thread>