PHPackages                             liliumdev/icalendar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. liliumdev/icalendar

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

liliumdev/icalendar
===================

A Composer package for creating icalendar files (ZContent/icalendar)

0.1.0(8y ago)486.3k↓47.4%3[1 PRs](https://github.com/liliumdev/icalendar/pulls)1GPL-3.0PHP

Since Oct 31Pushed 8y ago1 watchersCompare

[ Source](https://github.com/liliumdev/icalendar)[ Packagist](https://packagist.org/packages/liliumdev/icalendar)[ RSS](/packages/liliumdev-icalendar/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (1)

Zap Calendar iCalendar Library
==============================

[](#zap-calendar-icalendar-library)

()

The Zap Calendar iCalendar Library is a PHP library for supporting the iCalendar (RFC 5545) standard.

This PHP library is for reading and writing iCalendar formatted feeds and files. Features of the library include:

- Read AND write support for iCalendar files
- Object based creation and manipulation of iCalendar files
- Supports expansion of RRULE to a list of repeating dates
- Supports adding timezone info to iCalendar file

All iCalendar data is stored in a PHP object tree. This allows any property to be added to the iCalendar feed without requiring specialized library function calls. With power comes responsibility. Missing or invalid properties can cause the resulting iCalendar file to be invalid. Visit [iCalendar.org](http://icalendar.org) to view valid properties and test your feed using the site's [iCalendar validator tool](http://icalendar.org/validator.html).

Library API documentation can be found at

See the examples folder for programs that read and write iCalendar files. At its simpliest, you need to include the library at the top of your program:

```
require_once($path_to_library . "/zapcallib.php");
```

Create an ical object using the ZCiCal object:

```
$icalobj = new ZCiCal();
```

Add an event object:

```
$eventobj = new ZCiCalNode("VEVENT", $icalobj->curnode);
```

Add a start and end date to the event:

```
// add start date
$eventobj->addNode(new ZCiCalDataNode("DTSTART:" . ZCiCal::fromSqlDateTime("2020-01-01 12:00:00")));

// add end date
$eventobj->addNode(new ZCiCalDataNode("DTEND:" . ZCiCal::fromSqlDateTime("2020-01-01 13:00:00")));
```

Write the object in iCalendar format using the export() function call:

```
echo $icalobj->export();
```

This example will not validate since it is missing some required elements. Look at the simpleevent.php example for the minimum # of elements needed for a validated iCalendar file.

To create a multi-event iCalendar file, simply create multiple event objects. For example:

```
$icalobj = new ZCiCal();
$eventobj1 = new ZCiCalNode("VEVENT", $icalobj->curnode);
$eventobj1->addNode(new ZCiCalDataNode("SUMMARY:Event 1"));
...
$eventobj2 = new ZCiCalNode("VEVENT", $icalobj->curnode);
$eventobj2->addNode(new ZCiCalDataNode("SUMMARY:Event 2"));
...
```

To read an existing iCalendar file/feed, create the ZCiCal object with a string representing the contents of the iCalendar file:

```
$icalobj = new ZCiCal($icalstring);
```

Large iCalendar files can be read in chunks to reduce the amount of memory needed to hold the iCalendar feed in memory. This example reads 500 events at a time:

```
$icalobj = null;
$eventcount = 0;
$maxevents = 500;
do
{
	$icalobj = newZCiCal($icalstring, $maxevents, $eventcount);
	...
	$eventcount +=$maxevents;
}
while($icalobj->countEvents() >= $eventcount);
```

You can read the events from an imported (or created) iCalendar object in this manner:

```
foreach($icalobj->tree->child as $node)
{
	if($node->getName() == "VEVENT")
	{
		foreach($node->data as $key => $value)
		{
			if($key == "SUMMARY")
			{
				echo "event title: " . $value->getValues() . "\n";
			}
		}
	}
}
```

Known Limitations
-----------------

[](#known-limitations)

- Since the library utilizes objects to read and write iCalendar data, the size of the iCalendar data is limited to the amount of available memory on the machine. The ZCiCal() object supports reading a range of events to minimize memory space.
- The library ignores timezone info when importing files, instead utilizing PHP's timezone library for calculations (timezones are supported when exporting files). Imported timezones need to be aliased to a [PHP supported timezone](http://php.net/manual/en/timezones.php).
- At this time, the library does not support the "BYSETPOS" option in RRULE items.
- At this time, the maximum date supported is 2036 to avoid date math issues with 32 bit systems.
- Repeating events are limited to a maximum of 5,000 dates to avoid memory or infinite loop issues

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3168d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f9472942b8c2f6545e8ba9246545e1696380260b1e3f85f507bf78f7f7fac1d?d=identicon)[liliumdev](/maintainers/liliumdev)

---

Top Contributors

[![cogliano](https://avatars.githubusercontent.com/u/11013522?v=4)](https://github.com/cogliano "cogliano (11 commits)")[![liliumdev](https://avatars.githubusercontent.com/u/8971846?v=4)](https://github.com/liliumdev "liliumdev (2 commits)")

---

Tags

iCalendarliliumdev

### Embed Badge

![Health badge](/badges/liliumdev-icalendar/health.svg)

```
[![Health](https://phpackages.com/badges/liliumdev-icalendar/health.svg)](https://phpackages.com/packages/liliumdev-icalendar)
```

###  Alternatives

[eluceo/ical

The eluceo/iCal package offers an abstraction layer for creating iCalendars. You can easily create iCal files by using PHP objects instead of typing your \*.ics file by hand. The output will follow RFC 5545 as best as possible.

1.2k18.7M61](/packages/eluceo-ical)[spatie/icalendar-generator

Build calendars in the iCalendar format

6878.7M19](/packages/spatie-icalendar-generator)[sssurii/laravel-ics

Laravel package to create iCalendar / ICS files. Send new event invitations via Email and can cancel or update already sent invitation.

2162.8k](/packages/sssurii-laravel-ics)[welp/ical-bundle

Symfony Bundle to manage .ics iCal file (creating and eventually reading)

10116.0k](/packages/welp-ical-bundle)[coderevolutionplugins/gpt-3-encoder-php

PHP BPE Text Encoder/Decoder for GPT-2 / GPT-3

10051.5k](/packages/coderevolutionplugins-gpt-3-encoder-php)[aldemeery/enum-polyfill

A Polyfill for the SplEnum type in PHP

1258.9k](/packages/aldemeery-enum-polyfill)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
