[CMF-checkins] CVS: Products/CMFCalendar - Event.py:1.5

Jens Vagelpohl jens@zope.com
Wed, 3 Oct 2001 14:39:43 -0400


Update of /cvs-repository/Products/CMFCalendar
In directory cvs.zope.org:/tmp/cvs-serv12214

Modified Files:
	Event.py 
Log Message:
Added safeguards that will make sure that end_date is never before start_date



=== Products/CMFCalendar/Event.py 1.4 => 1.5 ===
         self.expiration_date = expiration_date
         self.setStartDate(start_date)
+        
+        if end_date < start_date:
+            end_date = start_date
+
         self.setEndDate(end_date)
         self.location=location
         self.contact_name=contact_name
@@ -258,6 +262,7 @@
                                  , start_time
                                  , startAMPM
                                  )
+        start_date = DateTime( efdate )
 
         exdate = '%s/%s/%s %s %s' % (expirationDay
                                  , expirationMo
@@ -265,9 +270,14 @@
                                  , stop_time
                                  , stopAMPM
                                  )
+        end_date = DateTime( exdate )
+
+        if end_date < start_date:
+            end_date = start_date
  
-        self.setStartDate(DateTime(efdate))
-        self.setEndDate(DateTime(exdate))
+        self.setStartDate( start_date )
+        self.setEndDate( end_date )
+
         if location is not None:
             self.location = location
         if contact_name is not None: