There is no license information available for the latest version (0.2.1) of this package.

Simple ICS generator for PHP

0.2.1 2018-10-30 14:01 UTC

This package is auto-updated.

Last update: 2024-02-29 02:38:11 UTC


README

Latest Stable Version Quality Gate Status

Simple ICS generator for PHP

Usage

When creating a new calendar, you can optionally pass a TZID as a string to the constructor to make sure it will be correctly interpreted (this is highly recommended). The list of supported timezones can be found here

$ics = new PIG\ICS('Europe/Paris'); // For example, or any timezone

Then you just have to put all your events using the addEvent function

$ics->addEvent(
        '2018-10-06 20:15:00', // Start
        '2018-10-07 02:00:00', // End
        'Awesome party', // Title
        'At my house', // Optionnal location
        'Amazing party, with friends and all' // Optionnal description
    )->addEvent( // You can chain theese calls if you want
        new \DateTime('2018-10-07 15:00:42'), // Dates can be a \Datetime too
        new \DateTime('2018-10-07 02:00:00'),
        'House cleaning ...'
    );

Finally to write the file on disk, you need to call the saveICS function, providing the path you want to write to

$ics->saveICS('path.ics');