Skip to content

dablumino/Codeninja.iCal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codeninja iCal library

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

Installation

The Codeninja iCal library is available via GitHub download only.

Usage

Basic Usage

Create a Calendar object

$calendar = new \Codeninja\iCal\Calendar('www.example-site.com');

Create a new Event object

$myEvent = new \Codeninja\iCal\Event();

Add required and optional information to the Event object

$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.');

Add event to calendar object

$calendar->addEvent($myEvent);

Generate & display output

$content = $calendar->render();
echo $content;

Timezone support

This component supports three different types of handling timezones:

1. UTC (default)

In the default setting, UTC will be used as Timezone. The time will be formated as following:

DTSTART:20170101T180000Z

Use locale time

You can use the local server time by set $myEvent->setUseUtc(false);.

DTSTART:20170101T180000

License

This software is distributed under the MIT license. Please read LICENSE for information on the software availability and distribution.

About

This library offers a abstraction layer for creating iCal Calendars and .ics files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages