/** * Check whether an event has not occurred. * * @param string $strTime Information about date and time in the following * format '2016-01-30 01:50' * @return boolean True if the event has not occurred, false otherwise */ public static function checkEventHasNotOccurred($strTime) { return DateUtils::compareToCurrentDate($strTime); }
/** * Formats information about events to be displayed on calendar events * main screen. * * @param array $eventListing Event listing in a given date range to be * formatted for visualization * @param int $currCalendarId The id of the current calendar in use * @param stdClass $currDateRange Formatted date range with month and * year values * @return array Formatted list of events */ private function formatEventsForVisualization($eventListing, $currCalendarId, $currDateRange) { if (isset($eventListing) && count($eventListing) > 0) { foreach ($eventListing as &$event) { $fromData = DateUtils::getInfomationAboutDate($event->from); $untilData = DateUtils::getInfomationAboutDate($event->until); $event->formattedDay = $fromData->dayVal; $event->formattedFrom = $fromData->timeVal; $event->formattedUntil = $untilData->timeVal; $event->formattedMonth = $fromData->monthName; $event->formattedWeekDay = $fromData->weekdayName; $event->notYetOccurred = DateUtils::compareToCurrentDate($event->from); $event->lnkOpenEvent = $this->makeUrl('Calendar.OpenEvent', array('from' => $event->from, 'until' => $event->until, 'idEvent' => $event->id, 'calendarId' => $currCalendarId, 'monthVal' => $currDateRange->monthVal, 'yearVal' => $currDateRange->yearVal)); } return $eventListing; } else { return array(); } }