PHP code example of jihoun / calendar
1. Go to this page and download the library: Download jihoun/calendar library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jihoun / calendar example snippets
$event = new \Jihoun\Calendar\Component\Event();
$event
->setDateTimeStart(new Property\DateTimeStart(new \DateTime()))
->setDateTimeEnd(new Property\DateTimeEnd(new \DateTime()))
->setDescription(new Property\Description('Very very lengthy description'))
->setLocation(new Property\Location('in the office'))
->setOrganizer(new Property\Organizer('[email protected]'))
->setSummary(new Property\Summary('new test event'));
$cal = new \Jihoun\Calendar\Calendar();
$cal->addComponent($event);
file_put_contents('cal.ics', $cal->toString());