From 23563c7188e089929b60f9e10721c6fc43a220ff Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Thu, 22 Jun 2023 23:06:12 +0200 Subject: Updated 15 files, added includes/maintenance/deleteUnusedAssets.php and deleted 4944 files (automated) --- includes/composer/ical/ical.php | 69 ----------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 includes/composer/ical/ical.php (limited to 'includes/composer/ical/ical.php') diff --git a/includes/composer/ical/ical.php b/includes/composer/ical/ical.php deleted file mode 100644 index 84d637c..0000000 --- a/includes/composer/ical/ical.php +++ /dev/null @@ -1,69 +0,0 @@ -parse(file_get_contents($content)); - } - } - - protected function parse(string $content) : iCal - { - $content = str_replace("\r\n ", '', $content); - - preg_match_all('`BEGIN:VEVENT(.+)END:VEVENT`Us', $content, $matches); - foreach($matches[0] as $eventContent) - { - $this->Events[] = new iCalEvent($eventContent); - } - - return $this; - } - - public function getEventsAfterDate(string $date) : array - { - $output = array(); - - $date = strtotime($date); - foreach ($this->Events as $event) - { - $eventTimestamp = strtotime($event->startDateTime); - if ($eventTimestamp >= $date) - { - $output[] = $event; - } - } - - asort($output); - return $output; - } - - public function getActiveEvents() : array - { - $output = array(); - - $currentDate = strtotime(date('Y-m-d')); - foreach ($this->Events as $event) - { - $eventStartTimestamp = strtotime($event->startDateTime); - $eventEndTimestamp = strtotime($event->endDateTime); - if ($currentDate >= $eventStartTimestamp && $currentDate <= $eventEndTimestamp) - { - $output[] = $event; - } - } - - asort($output); - return $output; - } -} \ No newline at end of file -- cgit