Changeset 50211

Show
Ignore:
Timestamp:
11/22/06 15:21:06 (3 years ago)
Author:
lregebro
Message:

Fixed #1736: Next month links crash on the last days of some month.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Zope2/CalZope/trunk/CHANGES

    r50205 r50211  
    88~~~~~~~~~ 
    99- The title of the main attendee is now displayed on the calendar pages. 
     10- Fixed #1736: Next month links crash on the last days of some month. 
    1011New internal features 
    1112~~~~~~~~~~~~~~~~~~~~~ 
  • Zope2/CalZope/trunk/browser/navigation.py

    r49479 r50211  
    204204     
    205205    def calcDate(self): 
    206         """Recalculates which day should be shown"""         
    207         return date(self.context.getYear(), self.context.getMonth(), self.day) 
     206        """Recalculates which day should be shown""" 
     207        try: 
     208            return date(self.context.getYear(),  
     209                        self.context.getMonth(),  
     210                        self.day) 
     211        except ValueError: 
     212            # The day is out of range. Lower the day with one and try again 
     213            # recursively until it works (four times, in the worst case): 
     214            self.day -= 1 
     215            return self.calcDate() 
    208216 
    209217    def todayInView(self):