This library offers a abstraction layer for creating iCal Calendars and .ics files. The output will be generated according [RFC 5545] .
The following types are currently supported:
- VCALENDAR
- VEVENT
The Codeninja iCal library is available via GitHub download only.
$calendar = new \Codeninja\iCal\Calendar('www.example-site.com');$myEvent = new \Codeninja\iCal\Event();$myEvent->setDtStart(new \DateTime());
$myEvent->setDtEnd(new \DateTime());
$myEvent->setisAllDay(true);
$myEvent->setSummary('Summary: Lorem Ipsum');
$myEvent->setDescription('Lorem Ipsum is simply dummy text of the printing and typesetting industry.');$calendar->addEvent($myEvent);$content = $calendar->render();
echo $content;This component supports three different types of handling timezones:
In the default setting, UTC will be used as Timezone. The time will be formated as following:
DTSTART:20170101T180000Z
You can use the local server time by set $myEvent->setUseUtc(false);.
DTSTART:20170101T180000
This software is distributed under the MIT license. Please read LICENSE for information on the software availability and distribution.