Skip to content

dablumino/Codeninja.iCal

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 

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

No packages published

Languages