cti/ics

该软件包最新版本(0.4)没有提供许可证信息。

ics管理

0.4 2015-04-20 09:45 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:09:31 UTC


README

Build Status Code Climate

当前库的目的是允许轻松操作.ics文件。

安装

使用Composer

将以下内容

  "cti/ics": "0.1"

添加到你的composer.json文件的"require"部分。

用法

命名日历,包含时区和两个事件

// initialise calendar
$calendar = new Calendar('Automated Test', 'Europe/London');

// add events to it
$calendar->add(new Event\Interval('2015-03-13 10:05:00', '2015-03-13 10:19:59', 'Daily scrum'));
$calendar->add(new Event\Interval('2015-03-13 10:30:00', '2015-03-13 10:49:59', 'Weekly project review'));

保存到文件

$path = '/tmp/generated.ics';
$generator = new Generator(new FileOutput($path));
$generator->calendar($calendar)->getOutput()->getAll();

输出到字符串

// grab the output in a string for later usage
$generator = new Generator(new StringOutput());
$output = $generator->calendar($calendar)->getOutput()->getAll();