示例#1
0
 /**
  * Returns all series dates based on the given post data
  *       
  * @return array Array of dates
  */
 function getExeceptionDates()
 {
     global $_CORELANG;
     $exceptionDates = array();
     $objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent();
     $objEvent->loadEventFromPost($_POST);
     $objEventManager = new \Cx\Modules\Calendar\Controller\CalendarEventManager($objEvent->startDate);
     $objEventManager->_setNextSeriesElement($objEvent);
     $dayArray = explode(',', $_CORELANG['TXT_CORE_DAY_ABBREV2_ARRAY']);
     foreach ($objEventManager->eventList as $event) {
         $startDate = $event->startDate;
         $endDate = $event->endDate;
         $exceptionDates[$this->format2userDate($startDate)] = $this->format2userDate($startDate) != $this->format2userDate($endDate) ? $dayArray[$this->formatDateTime2user($startDate, "w")] . ", " . $this->format2userDate($startDate) . ' - ' . $dayArray[$this->formatDateTime2user($endDate, "w")] . ", " . $this->format2userDate($endDate) : $dayArray[$this->formatDateTime2user($startDate, "w")] . ", " . $this->format2userDate($startDate);
     }
     return $exceptionDates;
 }
 /**
  * Returns all series dates based on the given post data
  *       
  * @return array Array of dates
  */
 function getExeceptionDates()
 {
     global $_CORELANG;
     $exceptionDates = array();
     $objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent();
     $objEvent->loadEventFromPost($_POST);
     $objEventManager = new \Cx\Modules\Calendar\Controller\CalendarEventManager($objEvent->startDate);
     $objEventManager->_setNextSeriesElement($objEvent);
     $dayArray = explode(',', $_CORELANG['TXT_CORE_DAY_ABBREV2_ARRAY']);
     foreach ($objEventManager->eventList as $event) {
         $exceptionDates[date(self::getDateFormat(), $event->startDate)] = $event->startDate != $event->endDate ? $dayArray[date("w", $event->startDate)] . ", " . date(self::getDateFormat(), $event->startDate) . ' - ' . $dayArray[date("w", $event->endDate)] . ", " . date(self::getDateFormat(), $event->endDate) : $dayArray[date("w", $event->startDate)] . ", " . date(self::getDateFormat(), $event->startDate);
     }
     return $exceptionDates;
 }