Author: jablko
Date: Thu Oct 28 04:20:05 2010
New Revision: 8630

Log:
Check against start and end date

Modified:
   trunk/plugins/sfIsadPlugin/lib/QubitValidatorIsadDates.class.php

Modified: trunk/plugins/sfIsadPlugin/lib/QubitValidatorIsadDates.class.php
==============================================================================
--- trunk/plugins/sfIsadPlugin/lib/QubitValidatorIsadDates.class.php    Thu Oct 
28 04:02:28 2010        (r8629)
+++ trunk/plugins/sfIsadPlugin/lib/QubitValidatorIsadDates.class.php    Thu Oct 
28 04:20:05 2010        (r8630)
@@ -43,11 +43,15 @@
             // equal and end date is less than or equal, or start or end dates
             // are missing
             if ((!isset($item->startDate)
-                  || !isset($event->startDate)
-                  || new DateTime($item->startDate) >= new 
DateTime($event->startDate))
+                  || ((!isset($event->startDate)
+                      || new DateTime($item->startDate) >= new 
DateTime($event->startDate))
+                    && (!isset($event->endDate)
+                      || new DateTime($item->startDate) <= new 
DateTime($event->endDate))))
                 && (!isset($item->endDate)
-                  || !isset($event->endDate)
-                  || new DateTime($item->endDate) <= new 
DateTime($event->endDate)))
+                  || ((!isset($event->startDate)
+                      || new DateTime($item->endDate) >= new 
DateTime($event->startDate))
+                    && (!isset($event->endDate)
+                      || new DateTime($item->endDate) <= new 
DateTime($event->endDate)))))
             {
               // Valid!  Check next event
               continue 3;

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to