iCalcreator 2.2.6
iCalcreator class v2.2.6
copyright (c) 2007 Kjell-Inge Gustafsson, kigkonsult
www.kigkonsult.se/iCalcreator
ical@kigkonsult.se

Description:

iCalcreator is a PHP implementation of RFC2445/RFC2446 to manage iCal/xCal formatted files.

1. INTRO

iCalcreator is a PHP class managing iCal formatted files for non-calendar systems like CMS, project management systems and other applications able to process calendar information like agendas, tasks, reports, totos, journaling data and for communication with calendar systems and applications.

iCalcreator is built of a single class file with a simple interface and are calendar component property oriented.

iCalcreator features create, parse and edit calendar and calendar components.

A short iCal description is found at Wikipedia. If You are not familiar with iCal, read this first!
Knowledge of calendar protocol rfc2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) AND rfc2446 - iCalendar Transport-Independent Interoperability Protocol (iTIP) Scheduling Events, BusyTime, To-dos and Journal Entries is to recommend! All functions calls are made as simple as possible BUT (, !!!,) read these rfc's properly!

Get RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) at text and HTML format, RFC2446 - iCalendar Transport-Independent Interoperability Protocol (iTIP) Scheduling Events, BusyTime, To-dos and Journal Entries in text format.

xCal (iCal xml) output format is supported but still experimental.

Examples how to employ iCalcreator in software development:
The iCal file event editor
Create complex iCal file on-the-fly

There are free iCal/xCal icons in the images directory, to use as buttons on a webpage.

1.1 INDEX

1. INTRO
1.1 INDEX

2. Calendar Component list
2.1 VCALENDAR
2.2 VEVENT
2.3 VTODO
2.4 VJOURNAL
2.5 VFREEBUSY
2.6 VALARM
2.7 VTIMEZONE

3. Function list
3.1 Calendar object functions
3.1.1 Calendar object constructors
3.1.1.1 vevent
3.1.1.2 vtodo
3.1.1.3 vjournal
3.1.1.4 vfreebusy
3.1.1.5 valarm
3.1.1.6 vtimezone

3.1.2 Calendar property functions
3.1.2.1 deleteProperty
3.1.2.2 getProperty
3.1.2.3 setProperty
3.1.2.4 CALSCALE
3.1.2.5 METHOD
3.1.2.6 VERSION
3.1.2.7 X-PROPERTY

3.1.3 Calendar component functions
3.1.3.1 deleteComponent
3.1.3.2 getComponent
3.1.3.3 setComponent

3.1.4 Calendar input/output functions
3.1.4.1 parse and merge
3.1.4.2 createCalendar
3.1.4.3 returnCalendar
3.1.4.4 saveCalendar
3.1.4.5 sort
3.1.4.6 useCachedCalendar

3.1.5 Calendar configuration functions
3.1.5.1 Component information
3.1.5.2 Delimiter
3.1.5.3 Directory
3.1.5.4 Fileinfo
3.1.5.5 Filename
3.1.5.6 Filesize
3.1.5.7 Format
3.1.5.8 Language
3.1.5.9 NewlineChar
3.1.5.10 Unique_id

3.1.6 Calendar misc. functions
3.1.6.1 validDate


3.2 Calendar component/object property function list
3.2.1 deleteProperty
3.2.2 getProperty
3.2.3 setProperty
3.2.4 ACTION
3.2.5 ATTACH
3.2.6 ATTENDEE
3.2.7 CATEGORIES
3.2.8 CLASS
3.2.9 COMMENT
3.2.10 COMPLETED
3.2.11 CONTACT
3.2.12 CREATED
3.2.13 DESCRIPTION
3.2.14 DTEND
3.2.15 DTSTAMP
3.2.16 DTSTART
3.2.17 DUE
3.2.18 DURATION
3.2.19 EXDATE
3.2.20 EXRULE
3.2.21 FREEBUSY
3.2.22 GEO
3.2.23 LAST-MODIFIED
3.2.24 LOCATION
3.2.25 ORGANIZER
3.2.26 PERCENTCOMPLETE
3.2.27 PRIORITY
3.2.28 RDATE
3.2.29 RECURRENCE-ID
3.2.30 RELATED-TO
3.2.31 REPEAT
3.2.32 REQUEST-STATUS
3.2.33 RESOURCES
3.2.34 RRULE
3.2.35 SEQUENCE
3.2.36 STATUS
3.2.37 SUMMARY
3.2.38 TRANSP
3.2.39 TRIGGER
3.2.40 TZID
3.2.41 TZNAME
3.2.42 TZOFFSETFROM
3.2.43 TZOFFSETTO
3.2.44 TZURL
3.2.45 UID
3.2.46 URL
3.2.47 X-PROPERTY

3.3 Calendar Component configuration functions
3.3.1 Language

3.4 Calendar component object misc. functions
3.4.1 deleteComponent
3.4.2 getComponent
3.4.3 setComponent

4. COPYRIGHT AND LICENSE

[index]

2. Calendar Component list

Quote from rfc2445! (Described in iCal output format, content corresponds to xCal format.)

2.1 VCALENDAR

icalobject = 1*("BEGIN" ":" "VCALENDAR" CRLF
icalbody
"END" ":" "VCALENDAR" CRLF)
 
icalbody = calprops component
 
calprops = 2*(
 
'prodid' and 'version' are both REQUIRED, but MUST NOT occur more than once
prodid / version /
 
'calscale' and 'method' are optional, but MUST NOT occur more than once
calscale /
method /
 
x-prop
 
)
 
component = 1*(eventc / todoc / journalc / freebusyc / timezonec / iana-comp* / x-comp*)
 
iana-comp = "BEGIN" ":" iana-token CRLF
1*contentline
"END" ":" iana-token CRLF
 
 
x-comp = "BEGIN" ":" x-name CRLF
1*contentline
"END" ":" x-name CRLF
*) not supported by iCalcreator
[index]

2.2 VEVENT

"BEGIN" ":" "VEVENT" CRLF
eventprop *alarmc
"END" ":" "VEVENT" CRLF
 
eventprop = *(
 
the following are optional,but MUST NOT occur more than once
class / created / description / dtstart /
geo / last-mod / location / organizer / priority /
dtstamp / seq / status / summary /
transp / uid / url / recurid /
 
either 'dtend' or 'duration' may appear in a 'eventprop',
but 'dtend' and 'duration' MUST NOT occur in the same 'eventprop'
dtend / duration /
 
the following are optional, and MAY occur more than once
attach / attendee / categories / comment /
contact / exdate / exrule / rstatus /
related / resources / rdate / rrule / x-prop
)
[index]

2.3 VTODO

"BEGIN" ":" "VTODO" CRLF
todoprop *alarmc
"END" ":" "VTODO" CRLF
 
todoprop = *(
 
the following are optional, but MUST NOT occur more than once
class / completed / created / description / dtstamp / dtstart /
geo / last-mod / location / organizer / percent / priority /
recurid / seq / status / summary / uid / url /
 
either 'due' or 'duration' may appear in a 'todoprop',
but 'due' and 'duration' MUST NOT occur in the same 'todoprop'
due / duration /
 
the following are optional,and MAY occur more than once
attach / attendee / categories / comment /
contact / exdate / exrule / rstatus /
related / resources / rdate / rrule / x-prop
)
[index]

2.4 VJOURNAL

journalc = "BEGIN" ":" "VJOURNAL" CRLF
jourprop
"END" ":" "VJOURNAL" CRLF
 
jourprop = *(
 
the following are optional, but MUST NOT occur more than once
class / created / description / dtstart /
dtstamp / last-mod / organizer / recurid /
seq / status / summary / uid / url /
 
the following are optional,and MAY occur more than once
attach / attendee / categories / comment /
contact / exdate / exrule / related /
rdate / rrule / rstatus / x-prop
)

[index]

2.5 VFREEBUSY

"BEGIN" ":" "VFREEBUSY" CRLF
fbprop
"END" ":" "VFREEBUSY" CRLF
 
fbprop = *(
 
the following are optional, but MUST NOT occur more than once
contact / dtstart / dtend / duration /
dtstamp / organizer / uid / url /
 
the following are optional,and MAY occur more than once
attendee / comment / freebusy / rstatus / x-prop
)
[index]

2.6 VALARM

"BEGIN" ":" "VALARM" CRLF
(audioprop / dispprop / emailprop / procprop)
"END" ":" "VALARM" CRLF
 
audioprop = 2*(
 
'action' and 'trigger' are both REQUIRED, but MUST NOT occur more than once
action / trigger /
 
'duration' and 'repeat' are both optional,and MUST NOT occur more than once each,
but if one occurs, so MUST the other
duration / repeat /
 
the following is optional, but MUST NOT occur more than once
attach /
 
the following is optional, and MAY occur more than once
x-prop
)
 
 
dispprop = 3*(
 
 
the following are all REQUIRED, but MUST NOT occur more than once
action / description / trigger /
 
'duration' and 'repeat' are both optional,and MUST NOT occur more than once each,
but if one occurs, so MUST the other
duration / repeat /
 
the following is optional, and MAY occur more than once
x-prop
)
 
 
emailprop = 5*(
 
the following are all REQUIRED, but MUST NOT occur more than once
action / description / trigger / summary
 
the following is REQUIRED, and MAY occur more than once
attendee /
 
'duration' and 'repeat' are both optional, and MUST NOT occur more than once each,
but if one occurs, so MUST the other
duration / repeat /
 
the following are optional, and MAY occur more than once
attach / x-prop
)
 
 
procprop = 3*(
the following are all REQUIRED, but MUST NOT occur more than once
action / attach / trigger /
 
'duration' and 'repeat' are both optional, and MUST NOT occur more than once each,
but if one occurs, so MUST the other
duration / repeat /
 
'description' is optional, and MUST NOT occur more than once
description /
 
the following is optional, and MAY occur more than once
x-prop
)
[index]

2.7 VTIMEZONE

"BEGIN" ":" "VTIMEZONE" CRLF
2*(
 
'tzid' is required, but MUST NOT occur more than once
tzid /
 
'last-mod' and 'tzurl' are optional, but MUST NOT occur more than once
last-mod / tzurl /
 
one of 'standardc' or 'daylightc' MUST occur and each MAY occur more than once.
standardc / daylightc /
 
the following is optional, and MAY occur more than once
x-prop
)
"END" ":" "VTIMEZONE" CRLF
 
standardc = "BEGIN" ":" "STANDARD" CRLF
tzprop
"END" ":" "STANDARD" CRLF
 
daylightc = "BEGIN" ":" "DAYLIGHT" CRLF
tzprop
"END" ":" "DAYLIGHT" CRLF
 
tzprop = 3*(
 
the following are each REQUIRED, but MUST NOT occur more than once
dtstart / tzoffsetto / tzoffsetfrom /
 
the following are optional, and MAY occur more than once
comment / rdate / rrule / tzname / x-prop
)
[index]

3. Function list

3.1 Calendar object functions

3.1.1 Calendar object constructors

Initiate new CALENDAR.

format

vcalendar()

example

$calendar = new vcalendar(); // initiate new CALENDAR

[index]

3.1.1.1 vevent

Initiate calendar component EVENT.

format

vevent()

example

$vevent = new vevent(); // initiate EVENT

[index]

3.1.1.2 vtodo

Initiate calendar component TODO.

format

vtodo()

example

$vtodo = new vtodo(); // initiate TODO

[index]

3.1.1.3 vjournal

Initiate calendar component JOURNAL.

format

vjournal()

example

$vjournal = new vjournal(); // initiate JOURNAL

[index]

3.1.1.4 vfreebusy

Initiate calendar component FREEBUSY.

format

vfreebusy()

example

$vfreebusy = new vfreebusy(); // initiate FREEBUSY

[index]

3.1.1.5 valarm

Initiate calendar component ALARM.

format

valarm()

example

$valarm = new valarm(); // initiate ALARM

[index]

3.1.1.6 vtimezone

Initiate calendar component TIMEZONE.

format

vtimezone()

example

$vtimezone = new vtimezone(); // initiate TIMEZONE

[index]

3.1.2 Calendar property functions

3.1.2.1 deleteProperty

General calendar deleteProperty function,simplifying calendar property delete.

format

deleteProperty( [ string PropName [, int order=1 ] )

Propnamecase independent, strict rfc2445 component property names, unknown/missing Propname will be regarded as X-property.
orderif missing 1st/next occurence, used with multiply property occurences

FALSE is returned if no property exists or at end-of-properties with consecutive function calls.

example 1

$v = new vcalendar();
$v->setConfig( 'filename', 'file.ics' );
$v->parse();
if( ! $v->deleteProperty( 'method' ))
  echo "error when deleting property.. . .. .

[index]

3.1.2.2 getProperty

General calendar getProperty function,simplifying calendar property getting.

format

getProperty( [ string PropName [, int order=1 [, bool complete=FALSE ]]] )

Propnamecase independent, strict rfc2445 component property names, unknown/missing Propname will be regarded as X-property.
orderif missing 1st/next occurence, used with multiply property occurences
completeFALSE (default) : output only property value
TRUE : output = array( 'value' => <value>, 'params' => <parameter array> )

FALSE is returned if no property exists or at end-of-properties with consecutive function calls.

example 1

$v = new vcalendar();
$v->setConfig( 'filename', 'file.ics' );
$v->parse();
$calscale = $v->getProperty( 'calscale' );
.. .

example 2

$v = new vcalendar();
$v->setConfig( 'filename', 'file.ics' );
$v->parse();
while( $xprop = $v->getProperty( )) { // get x-properties in order.. .
.. .

[index]

3.1.2.3 setProperty

General calendar setProperty function,simplifying calendar property setting.

format

setProperty( string PropName, mixed Proparg_1 *[, mixed Proparg_n] )

Propname case independent, strict rfc2445 calendar property names, unknown Propname will be regarded as X-property.

example

$calendar = new vcalendar(); // initiate new CALENDAR
$calendar->setProperty( 'calscale', 'GREGORIAN' );

[index]

3.1.2.4 CALSCALE

This property defines the calendar scale used for the calendar information specified in the iCalendar object.
Get Calscale

format

getProperty( 'calscale' )

example

$v = new vcalendar();
$v->setConfig( 'filename', 'file.ics' );
$v->parse();
$calscale = $v->getProperty( 'calscale' );
.. .

Set Calscale

format

setProperty( 'calscale', string value )

example

$calendar = new vcalendar(); // initiate new CALENDAR
$calendar->setProperty( 'calscale', 'GREGORIAN' );

[index]

3.1.2.5 METHOD

This property defines the iCalendar object method associated with the calendar object.
METHOD property (value PUBLISH etc.) may be required when importing iCal files into MS Outlook 2003 (as well as the auto created component properties DTSTAMP and UID).
Get Method

format

getProperty( 'method' )

example

$v = new vcalendar();
$v->setConfig( 'filename', 'file.ics' );
$v->parse();
$method = $v->getProperty( 'method' )
.. .

Set Method

format

setProperty( 'method', string value )

example

$calendar = new vcalendar(); // initiate new CALENDAR
$calendar->setProperty( 'method', 'PUBLISH' )

[index]

3.1.2.6 VERSION

This property specifies the identifier corresponding to the highest version number or the minimum and maximum range of the iCalendar specification that is required in order to interpret the iCalendar object.
Only version 2.0 valid, version is AUTO generated at calendar creation.
Get Version

format

getProperty( 'version' )

example

$v = new vcalendar();
$v->setConfig( 'filename', 'file.ics' );
$v->parse();
$version = $v->getProperty( 'version' )
.. .

Set Version

format

setProperty( 'version', string version )

example

$calendar = new vcalendar(); // initiate new CALENDAR
$calendar->setProperty( 'version', '2.0' )

[index]

3.1.2.7 X-PROPERTY

Any calendar component property name with a "X-" prefix and text value. If x-prop with the same name exists, it will be replaced.
Get X-property

format

getProperty()

output = array( propertyName 1 , propertyData 2 )

getProperty( FALSE, int propOrderNo/FALSE, TRUE )

output = array( propertyName 1
, array( 'value'=> propertyData 2 )
, 'params'=> params 3))

example 1

$v = new vcalendar();
$v->setConfig( 'filename', 'file.ics' );
$v->parse();
while( $xprop = $v->getProperty( )) {
.. .

$xprop = array( propertyName 1, propertyData 2 )

example 2

$v = new vcalendar();
$v->setConfig( 'filename', 'file.ics' );
$v->parse();
while( $xprop = $v->getProperty( 'X-WR-TIMEZONE' )) {
.. .

$xprop = array( 'X-WR-TIMEZONE', propertyData 2 )

example 3

$v = new vcalendar();
$v->setConfig( 'filename', 'file.ics' );
$v->parse();
while( $xprop = $v->getProperty( FALSE, FALSE, TRUE )) {
.. .

$xprop = array( propertyName 1
, array( 'value'=> propertyData 2 )
, 'params'=> params 3 )

Set X-property

format

setProperty( propertyName, propertyData [, params ] )

propertyName 1=Any property name with a "X-" prefix
propertyData 2=Value type TEXT
params 3=array( ['LANGUAGE' => '<lang>'] [, xparam] )
xparam=*[ xparamkey => xparamvalue ]

example

$calendar = new vcalendar(); // initiate new CALENDAR
$calendar->setProperty( 'X-WR-CALNAME', 'Calendar Sample' ); // set some X-properties.. .
$calendar->setProperty( 'X-WR-CALDESC', 'Calendar Description' );
$calendar->setProperty( 'X-WR-TIMEZONE', 'Europe/Stockholm' );


[index]

3.1.3 Calendar component functions

3.1.3.1 deleteComponent

Remove component from calendar.

format 1

deleteComponent( int orderNumber )

Remove component with order number (1st=1, 2nd=2.. .).

format 2

deleteComponent( string componentType [, int componentSuborderNumber])

Remove component with component type (ex. 'vevent') and order 1 alt. suborder number.

format 3

deleteComponent( string UID )

Remove component with UID. N.B UID is NOT set for alarm/timezone components.

example

$v = new vcalendar();
$v->setConfig( 'filename', 'file.ics' );
$v->parse();
$v->deleteComponent( 1 );
.. .

[index]

3.1.3.2 getComponent

Get component from calendar.

format 1

getComponent()

Get next component, until end-of-components.

format 2

getComponent( int orderNumber )

Get component with order number (1st=1, 2nd=2.. .).

format 3

getComponent( string componentType [, int componentSuborderNumber])

Get (next) component with component type (until end-of-components) alt.
Get component with component type and suborder number (1st=1, 2nd=2.. .).

format 4

getComponent( string UID )

Get component with UID as key. N.B UID is NOT set for alarm/timezone components.

example

$v = new vcalendar();
$v->setConfig( 'filename', 'file.ics' );
$v->parse();
while( $comp = $v->getComponent()) {
.. .

[index]

3.1.3.3 setComponent

Add calendar component to calendar or replace/update component in calendar.

format 1

setComponent( component )
addComponent( component ) // alias

Insert last in component chain.

format 2

setComponent( component, int orderNumber )

Replace component with order number (1st=1, 2nd=2.. .). if orderNumber is not found, component is inserted last in chain.

format 3

setComponent( component, string componentType [, component suborder number])

Replace component with component type and 1st alt. component order number. if orderNumber is not found, component is inserted last in chain.

format 4

setComponent( component, string UID )

Replace component with UID. N.B UID is NOT set for alarm/timezone components. If UID is not found, component is inserted last in chain.

example

$calendar = new vcalendar(); // initiate new CALENDAR
.. .
$vevent = new vevent(); // initiate EVENT
$vevent->setProperty( 'dtstart' // add some event properties
, 2006, 12, 24, 19, 30, 00 );
$vevent->setProperty(.. .
.. .
$calendar->setComponent ( $vevent ); // add event to calendar
.. .

[index]

3.1.4 Calendar input/output functions

3.1.4.1 parse and merge

Parse iCal file(-s) into a single vcalendar object (components, properties and parameters).

If missing, component property UID is created when parsing. For that reason UNIQUE_ID might need to be set before parsing.
Due to a limitation in PHP command strtotime, strtotime sets dates before 'January 1 1970 00:00:00 GMT' to 'January 1 1970'.

format

parse( [ string filename ] )

filename including (!) path/directory.

parse example

$vcalendar = new vcalendar();
$vcalendar->setConfig( 'filename', 'file.ics' );
$vcalendar->parse();
.. .

merge example

$vcalendar = new vcalendar();
$vcalendar->setConfig( 'unique_id', 'domain.com' );
$vcalendar->setConfig( 'directory', 'import' );

$vcalendar->setConfig( 'filename',  'file1.ics' );
$vcalendar->parse();

$vcalendar->setConfig( 'filename',  'file2.ics' );
$vcalendar->parse();

$vcalendar->sort();
$vcalendar->setConfig( 'filename',  'icalmerge.ics' );
$vcalendar->setConfig( 'directory', 'export' );
$vcalendar->saveCalendar();
.. .

[index]

3.1.4.2 createCalendar

Generate and return calendar in a string, testing.. .?

format

createCalendar()

example

.. .
$str = $calendar->createCalendar();
echo $str;

[index]

3.1.4.3 returnCalendar

Redirect output to user browser, uses present dir if not set, filenamn is auto generated if missing/not set;
$filename = date( 'YmdHis' ).'.ics'
Directory/filename must be writeable, delimiter default PHP constant DIRECTORY_SEPARATOR.

format

returnCalendar ( [string directory/FALSE [, string filename/FALSE [, string delimiter/FALSE ]]] )

Parameters for directory/filename/delimeter, kept for backward compatibility, may be removed i future versions. Recommendation is to use setConfig, se example below.

example

.. .
$calendar->setConfig( 'directory', '/tmp' );
$calendar->setConfig( 'filename', 'calendar.ics' );
$calendar->returnCalendar();

[index]

3.1.4.4 saveCalendar

Save ical calendar in a file, uses present directory if directory not set, filenamn is auto generated if missing/not set;
$filename = date( 'YmdHis' ).'.ics'
Directory/filename must be writeable, delimiter default PHP constant DIRECTORY_SEPARATOR.

format

saveCalendar ( string directory/FALSE [, string filename/FALSE [, string delimiter/FALSE ]] )

Parameters for directory/filename/delimeter, kept for backward compatibility, may be removed i future versions. Recommendation is to use setConfig, se example below.

example

$calendar->setConfig( 'directory', '/tmp' );
$calendar->setConfig( 'filename', 'calendar.ics' );
$result = $calendar->saveCalendar();
if( !$result )
  echo 'error when saving.. .

[index]

3.1.4.5 sort

Sort created/parsed calendar components in ascending order DTSTART - DTEND/DUE/DURATION.

format

sort()

example

$calendar = new vcalendar();
$calendar->setConfig( 'directory', '/tmp' );
$calendar->setConfig( 'filename', 'calendar.ics' );
$calendar->parse();
$calendar->sort();
$calendar->returnCalendar();

[index]

3.1.4.6 useCachedCalendar

If recent version of (nonempty) file exists (timeout default 3600 sec), a HTTP redirect header is sent otherwise FALSE is returned.

format

useCachedCalendar( string directory/FALSE, string filename/FALSE , string delimiter/FALSE [, int timeout ] )

Parameters for directory/filename/delimeter, kept for backward compatibility, may be removed i future versions. Recommendation is to use setConfig, se example below.

example

.. .
$calendar->setConfig( 'directory', '/tmp' );
$calendar->setConfig( 'filename', 'calendar.ics' );
$calendar->useCachedCalendar();

[index]

3.1.5 Calendar configuration functions

3.1.5.1 Component information

Get information about calendar components. Returns array with basic information about all components (in array format) within calendar.

format

getConfig( 'compsinfo' )

Output=array( *compinfo )
compinfo=array( 'ordno'=> int ordno, // order number (1st=1, 2nd=2..)
, 'type' => string type// component type (vevent, vtodo.. .
, 'uid' => string uid // component UID (not for alarm/timezone)
, 'props' => array( *[ propertyName=>Property count ] )// for every set property
, 'sub' => array( *compinfo ))// if subcomponents exists, an array with info for each subcomponent

example

$v = new vcalendar();
$v->parse( 'file.ics' );
$compsinfo = $v->getConfig( 'compsinfo' );
foreach( $compsinfo as compinfo) {
 echo ' order number : '.$compinfo['ordno'];
 echo ' type : '.$compinfo[type'];
 echo ' UID : '.$compinfo['uid'];
 foreach( $compinfo['props'] as $propertyName => $propertyCount )
  echo " $propertyName = $propertyCount";
 if( is_array( $compinfo['sub'] )) {
  foreach( $compinfo['sub'] as $subcompinfo ) {
   echo ' order number : '.$subcompinfo['ordno'];
   /* .. dito if subcomponents exists .. . */
  }
 }
}

[index]

3.1.5.2 Delimiter

Directory/filename delimiter.
Get delimiter

format

getConfig( 'delimiter' )

example

$del = $calendar->getConfig( 'delimiter' );

Set delimiter
Default PHP constant DIRECTORY_SEPARATOR. If used, must be set BEFORE filename!

format

setConfig( 'delimiter', string <delimiter> )

example

$calendar->setConfig( 'delimiter', '/' );

[index]

3.1.5.3 Directory

Directory to store/read iCal files, default '.'.
Get directory

format

getConfig( 'directory' )

example

$folder = $calendar->getConfig( 'directory' );

Set directory
Directory must be set BEFORE filename and be writeable otherwise FALSE is returned.

format

setConfig( 'directory', string <directory> )

example

$calendar->setConfig( 'directory', '/tmp' );

[index]

3.1.5.4 Fileinfo

Get fileinfo

format

getConfig( 'fileinfo' )

example

$fileinfo = $calendar->getConfig( 'fileinfo' );

output = array( <directory>, <filename>, <filesize> )


[index]

3.1.5.5 Filename

iCal file name, default created, if not set;
$filename = date( 'YmdHis' ).".ics"
Get filename

format

getConfig( 'filename' )

example

$filename = $calendar->getConfig( 'filename' );

Set filename
Filename must be set AFTER directory (and ev. delimiter)! Filename (and ev. set directory) must be readable/writeable otherwise FALSE is returned.

format

setConfig( 'filename', string <filename> )

example

$calendar->setConfig( 'filename', 'calendar.ics' );

[index]

3.1.5.6 Filesize

Get filesize
To be called after "saveCalendar"/"returnCalendar" or after "setConfig( 'filename' )" (before parse).

format

getConfig( 'filesize' )

example

$filesize = $calendar->getConfig( 'filesize' );

[index]

3.1.5.6 Format

Format for calendar output, iCal/xCal.
Get format
If format was set to 'xcal' , 'xcal' is returned.

format

getConfig( 'format' )

example

$format = $calendar->getConfig( 'format' );

Set format
'iCal' is preset, default.

format

setConfig( 'format', string <format> )

example

$calendar->setConfig( 'format', 'xcal' );

[index]

3.1.5.8 Language

Language for calendar and component properties as defined in [RFC 1766].
Get language
Language for calendar (only if language is set at calendar level).

format

getConfig( 'language' )

example

$lang = $calendar->getConfig( 'language' );

Set language
Set language for whole calendar, will be used everywhere its apropriate. Language set at calendar level can be overridden by "setConfig( 'language', .." at component level or in specific component property parameter.

format

setConfig( 'language', string <lang> )

example

$calendar->setConfig( 'lang', 'en' );

[index]

3.1.5.9 NewlineChar

Character(s) used for carriage return + line feed (CR+LF), default PHP constant DIRECTORY_SEPARATOR.
Get Newlinechar
Get character(s) used for carriage return + line feed (CR+LF).

format

getConfig( 'newlinechar' )
getConfig( 'nl' ) // alias

example

$nl = $calendar->getConfig( 'nl' );

Set Newlinechar
Set character(s) used for carriage return + line feed (CR+LF).

format

setConfig( 'newlinechar', string <char> )
setConfig( 'nl', string <char> ) // alias

example

$calendar->setConfig( 'nl', "\n" );

[index]

3.1.5.10 Unique_id

* The identifier is RECOMMENDED to be the identical syntax to the
* [RFC 822] addr-spec. A good method to assure uniqueness is to put the
* domain name or a domain literal IP address of the host on which.. .
Default AUTO generated ( gethostbyname( $_SERVER['SERVER_NAME'] )). Can to be used to set other domain name than server name. Unique_id is used when creating property PRODID (auto created) at calendar level and UID at component level.
Get unique id

format

getConfig( 'unique_id' )

example

$id = $calendar->getConfig( 'unique_id' );

Set unique id
Recommendation to set unique_id just after creating a new vcalendar object, to ensure accurate setting of component UID.

format

setConfig( 'unique_id', string <unique-Id> )

example

$calendar = new vcalendar(); // initiate new CALENDAR
$calendar->setConfig( 'unique_id', 'domain.com' );

[index]

3.1.6 Calendar misc. functions

3.1.6.1 validDate

Check and convert input parameter date (different formats), return date in iCalcreator (internal) date format.

format

validDate( date [, bool utc/FALSE ] )

date=int year, int month, int day [, int hour, int min, int sec, mixed tz ]]
date=array( int year, int month, int day [, int hour, int min, int sec, mixed tz ]] )
date=array ( 'year' => int year, 'month' => int month, 'day' => int day [, 'hour' => int hour, 'min' => int min, 'sec' => int sec, 'tz' => mixed tz ] )
date=array ( 'timestamp' => int timestamp [, 'tz' => mixed tz ] )
date=string datestring // date in a string, acceptable by strtotime-command, ex. '14 august 2006 16.00.00' (due to strtotime-limitation, dates before 'January 1 1970 00:00:00 GMT'.. .)
tz=timezone / offset
offset=(+/-)HHmm[ss]
utc=TRUE and tz = UTC offset then input local date + UTC offset sets UTC format date

example

$c = new vcalendar ();
$today = date("M d Y H:i:s");
$UTCoffset = date( 'Z'); // offset in seconds
if( '-' == substr( $UTCoffset, 0, 1 )) {
  $UTCoffset = substr( $UTCoffset, 1 );
  $sign = '-';
}
else {
  $sign = '+';
}
$UTCoffsetHour = $UTCoffset / 3600;
$UTCoffsetMod = $UTCoffset % 3600;
$UTCoffsetMin = $UTCoffsetMod / 60;
$UTCoffsetSec = $UTCoffsetMod % 60;
$UTCoffset = sprintf( $sign."%02d%02d%02d", $UTCoffsetHour, $UTCoffsetMin, $UTCoffsetSec );
$today .= ' '.$UTCoffset; // UTC offset in accepted format, (+/-)HHMM[SS]
$date = $c->validDate( $today );
if( FALSE == $date ) {
  echo "unvalid date $today";
}
else {
  $e = new vevent();
  $e->setProperty( 'dtstart', $date );
  .. .

[index]

3.2 Calendar component object property function list

All calendar component property functions for get/set data.
For property format in detail, see RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.

Note: for properties and DATE-TIME WITH UTC TIME.
The date with UTC time, or absolute time, is identified by a LATIN CAPITAL LETTER Z suffix character (US-ASCII decimal 90), the UTC designator, appended to the time value. For example, the following represents January 19, 1998, at 0700 UTC:

DTSTART:19980119T070000Z

The TZID property parameter MUST NOT be applied to DATE-TIME properties whose time values are specified in UTC. (quote from rfc2445)

3.2.1 deleteProperty

General calendar delete property function,simplifying calendar property delete.

format

deleteProperty( [ string PropName [, int order=1 ] )

Propnamecase independent, strict rfc2445 component property names, unknown/missing Propname will be regarded as X-property.
orderif missing 1st/next occurence, used with multiply property occurences

FALSE is returned if no property exists or at end-of-properties with consecutive function calls.

example 1

$v = new vcalendar();
$v->parse( 'file.ics' );
$e = $v->getComponent( 'vevent' );
while( FALSE !== $e->deleteProperty( 'comment' ))
  continue; // remove all COMMENT properties .. .

[index]

3.2.2 getProperty

General get property function,simplifying component property getting.

format

getProperty( string PropName [, int order=1 [, bool complete=FALSE ]] )

Propnamecase independent, strict rfc2445 component property names, unknown/missing Propname will be regarded as X-property.
orderif missing/FALSE 1st/next occurence, otherwise with multiply occurences (1st=1, 2nd=2.. .)
completeFALSE (default) : output only property value
TRUE : output = array( 'value' => <value>, 'params' => <parameter array> )

example

$v = new vcalendar();
$v->parse( 'file.ics' );
while( $vevent = $v->getComponent( 'vevent' )) {
 $dtstart = $vevent->getProperty( 'dtstart' ); // one occurence
 $description = $vevent->getProperty( 'description' ); // one occurence
 while( $comment = $vevent->getProperty( 'comment' )) { // MAY occur more than once
.. .

[index]

3.2.3 setProperty

General set property function,simplifying component property setting.

format

setProperty( string PropName, mixed Proparg_1 *[, mixed Proparg_n] )

Propname case independent, strict rfc2445 component property names, unknown Propname will be regarded as X-property.

example

$vevent = new vevent();
$vevent->setProperty( 'dtstart', array( 'year'=>2007, 'month'=>4, 'day'=>1, 'hour'=>19 ));
$vevent->setProperty( 'duration', 0, 0, 3 ));
$vevent->setProperty( 'LOCATION', 'Central Placa' );
$vevent->setProperty( 'summary', 'PHP summit' );
.. .

[index]

3.2.4 ACTION

This property defines the action to be invoked when an alarm is triggered.
get ACTION

format

getProperty( 'Action' )

output = actionValue 1

getProperty( 'Action', FALSE , TRUE )

output = array( 'value' => actionValue 1
, 'params' => xparam 2 )

example

$action = $valarm->getProperty( 'action' );

set ACTION

format

setProperty( 'Action', actionValue [, xparam ] )

actionValue 1=one of "AUDIO" / "DISPLAY" / "EMAIL" / "PROCEDURE"
xparam 2=array( *[ xparamkey => xparamvalue ] )

example

$valarm->setProperty( 'action', 'DISPLAY' );

[index]

3.2.5 ATTACH

The property provides the capability to associate a document object with a calendar component.
get ATTACH

format

getProperty( 'Attach' )

output = attachValue 1

getProperty( 'ATTACH', FALSE , TRUE )

output = array( 'value' => attachValue 1
, 'params' => params 2 )

example

$attach = $valarm->getProperty( 'attach' );

Set ATTACH

format

setProperty( 'attach', attachValue 1 [, params ] )

attachValue 1=The default value type for this property is URI. The value type (in params array) can also be set to BINARY to indicate inline binary encoded content information.
params 2=array( [ 'ENCODING' => 'BASE64', 'VALUE' => 'BINARY' ]
[,  'FMTTYPE' => contentType]
[, xparam] )
contentType=The parameter value MUST be the TEXT for either an IANA registered content type or a non-standard content type.
xparam=*[ xparamkey => xparamvalue ]

example

$vevent->setProperty('attach'
,'ftp://domain.com/pub/docs/agenda.doc'
,array( 'FMTTYPE' => 'application/binary' ));

[index]

3.2.6 ATTENDEE

The property defines an "Attendee" within a calendar component.
get ATTENDEE

format

getProperty( 'Attendee' )

output = attendeeValue 1

getProperty( 'ATTENDEE', int propOrderNo/FALSE , TRUE )

output = array( 'value' => attendeeValue 1
, 'params' => array( params 2 ))

example

$attendee = $valarm->getProperty( 'attendee' );

Set ATTENDEE
Default parameter values are removed.

format

setProperty( 'attendee', attendeeValue [, params ] )

attendeeValue 1=a calendar user address, a URI as defined by [RFC 1738] or any other IANA registered form for a URI.
params 2=array( [CUTYPE] [, MEMBER] [, ROLE] [, PARTSTAT] [, RVSP] [, DELEGATED-TO] [, DELEGATED-FROM] [, SENT-BY] [, CN] [, DIR] [, LANGUAGE] [, xparams] )
CUTYPE="CUTYPE" =>   "INDIVIDUAL";An individual, Default
/ "GROUP";A group of individuals
/ "RESOURCE";A physical resource
/ "ROOM";A room resource
/ "UNKNOWN";Otherwise not known
/ x-name;Experimental type
/ iana-token;Other IANA registered type
MEMBER="MEMBER" =>   array( *[ 'single member of the group or list membership' ] )
ROLE="ROLE" =>   "CHAIR";Indicates chair of the calendar entity
/ "REQ-PARTICIPANT";A participant whose participation is required, Default
/ "OPT-PARTICIPANT";A participant whose participation is optional
/ "NON-PARTICIPANT";A participant who is copied for information purposes only
/ x-name;Experimental role
/ iana-token;Other IANA role
PARTSTAT="PARTSTAT" =>   "NEEDS-ACTION";Event needs action, Default
/ "ACCEPTED";Event accepted
/ "DECLINED";Event declined
/ "TENTATIVE";Event tentatively accepted
/ "DELEGATED";Event delegated
/ "NEEDS-ACTION";To-do needs action, Default
/ "ACCEPTED";To-do accepted
/ "DECLINED";To-do declined
/ "TENTATIVE";To-do tentatively accepted
/ "DELEGATED";To-do delegated
/ "COMPLETED";To-do completed. COMPLETED property has date/time completed.
/ "IN-PROCESS";To-do in process of being completed
/ "NEEDS-ACTION";Journal needs action, Default
/ "ACCEPTED";Journal accepted
/ "DECLINED";Journal declined
/ x-name;Experimental status
/ iana-token;Other IANA registered status
RSVP="RSVP" =>   "TRUE" / "FALSE" Default;reply expectation
DELEGATED-TO="DELEGATED-TO" =>   array( *[ 'single calendar user to whom the calendar user specified by the property has delegated participation' ] )
DELEGATED-FROM="DELEGATED-FROM" =>   array( *[ 'single calendar user that have delegated their participation to the calendar user specified by the property' ] )
SENT-BY="SENT-BY" =>   'single calendar user that is acting on behalf of the calendar user specified by the property'
LANGUAGE="LANGUAGE" =>   'language for text values in CN parameter'
CN="CN" =>   'common name to be associated with the calendar user specified by the property'
DIR="DIR" =>   'reference to a directory entry associated with the calendar user specified by the property'
xparam=*[ xparamkey =>   xparamvalue ]
See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.

example

$vevent->setProperty('attendee'
,'attendee1@ical.net'
$vevent->setProperty('attendee'
,'attendee2@ical.net'
,array('cutype'=>'INDIVIDUAL'
,'member'=>
array( 'member1@ical.net'
, 'member2@ical.net'
, 'member3@ical.net' )
,'role'=>'CHAIR'
,'PARTSTAT'=>'ACCEPTED'
,'RSVP'=>'TRUE'
,'DELEgated-to'=>
array( 'part1@ical.net'
, 'part2@ical.net'
, 'part3@ical.net' )
,'delegateD-FROM'=>
array( 'part4@ical.net'
, 'part5@ical.net'
, 'part6@ical.net' )
,'SENT-BY'=>'part7@ical.net'
,'LANGUAGE'=>'us-EN'
,'CN'=>'John Doe'
,'DIR'=>'http://www.ical.net/doc/info.doc'
,'x-agenda'=>'status report' // xparam
,'x-length'=>'15 min' // xparam ));

[index]

3.2.7 CATEGORIES

This property defines the categories for a calendar component.
get CATEGORIES

format

getProperty( 'CATEGORIES' )

output = categoryValue 1

getProperty( 'CATEGORIES', int propOrderNo/FALSE , TRUE )

output = array( 'value' => categoryValue 1
, 'params' => params 2 )

example

$categories = $valarm->getProperty( 'categories' );

Set CATEGORIES

format

setProperty( 'categories', mixed categoriesValue [, params ] )

categoriesValue=string categoryValue / array( *categoryValue )
categoryValue 1=textual categories or subtypes of the calendar component, can be specified as a list of categories separated by the COMMA character
params 2=array( ['LANGUAGE' => '<lang>'][, xparam] )
xparam=*[ xparamkey => xparamvalue ]

example

$vevent->setProperty( 'categories', 'project_x' );

[index]

3.2.8 CLASS

This property defines the access classification for a calendar component.
get CLASS

format

getProperty( 'CLASS' )

output = classValue 1

getProperty( 'CLASS', FALSE , TRUE )

output = array( 'value' => classValue 1
, 'params' => xparam 2 )

example

$class = $valarm->getProperty( 'class' );

set CLASS

format

setProperty( 'class', string classvalue [, xparam ] )

classvalue 1="PUBLIC" / "PRIVATE" / "CONFIDENTIAL" / iana-token / x-name
xparam 2=array( *[ xparamkey => xparamvalue ] )

example

$vevent->setProperty( 'class', 'CONFIDENTIAL' );

[index]

3.2.9 COMMENT

This property specifies non-processing information intended to provide a comment to the calendar user.
get COMMENT

format

getProperty( 'COMMENT' )

output = commentValue 1

getProperty( 'COMMENT', int propOrderNo/FALSE , TRUE )

output = array( 'value' => commentValue 1
, 'params' => params 2 )

example

$comment = $vevent->getProperty( 'comment' );

Set COMMENT

format

setProperty( 'comment', commentValue [, params ] )

commentValue 1=Value type Text
params 2=array ( ['LANGUAGE' => '<lang>']
[, 'ALTREP' => '<alt.text>']
[, xparam] )
xparam=*[ xparamkey => xparamvalue ]

example

$vevent->setProperty( 'comment', 'this is a comment' );

[index]

3.2.10 COMPLETED

This property defines the date and time that a to-do was actually completed.
get COMPLETED

format

getProperty( 'COMPLETED' )

output = completedDate 1

getProperty( 'COMPLETED', FALSE , TRUE )

output = array( 'value' => completedDate 1
, 'params' => xparam 2 )

example

$completed = $vtodo->getProperty( 'completed' );

Set COMPLETED

format

setProperty( 'completed', mixed completedDate [, xparam ] )

completedDate:Always UTC format!
completedDate 1=array ( 'year' => int year, 'month' => int month, 'day' => int day [, 'hour' => int hour, 'min' => int min, 'sec' => int sec] )
completedDate=int year, int month, int day [, int hour, int min, int sec]
completedDate=array( int year, int month, int day [, int hour, int min, int sec] )
completedDate=array ( 'timestamp' => int timestamp )
completedDate=string datestring // date in a string, acceptable by strtotime-command, ex.  '14 august 2006 16.00.00' (due to strtotime-limitation, dates before 'January 1 1970 00:00:00 GMT'.. .)
xparam 2=array( *[ xparamkey => xparamvalue ] )

example 1

$vtodo->setProperty( 'completed', 2006, 8, 10 ); // 10 august 2006 UTC

example 2

$vcalendar = new vcalendar();
$vtodo = new vtodo();
.. .
$date = array('year' => 2006, 'month' => 10, 'day' => 10, 'tz' => '+0200');
$date = $vcalendar->validDate( $date, TRUE );
// local date + UTC offset sets UTC format date
$vtodo->setProperty( 'completed', $date );
.. .

[index]

3.2.11 CONTACT

The property is used to represent contact information or alternately a reference to contact information associated with the calendar component.
get CONTACT

format

getProperty( 'CONTACT' )

output = contactValue 1

getProperty( 'CONTACT', int propOrderNo/FALSE , TRUE )

output = array( 'value' => contactValue 1
, 'params' => params 2 )

example

$contact = $vevent->getProperty( 'contact' );

Set CONTACT

format

setproperty( 'contact', contactValue [, params] )

contactValue 1=Value type TEXT
params 2=array ( ['LANGUAGE' => '<lang>']
[, 'ALTREP' => '<alt.text>']
[, xparam] )
xparam=*[ xparamkey => xparamvalue ]

example

$c->setProperty( 'contact', 'tel 012-34 56 789' )

[index]

3.2.12 CREATED

This property specifies the date and time that the calendar information was created by the calendar user agent in the calendar store.
get CREATED

format

getProperty( 'CREATED' )

output = createdDate 1

getProperty( 'CREATED', FALSE , TRUE )

output = array( 'value' => createdDate 1
, 'params' => xparam 2 )

example

$created = $vevent->getProperty( 'CREATED' );

Set CREATED

format

setProperty( 'created', [ createdDate [, xparam ]] )

createdDate:Always UTC format!
createdDate 1=array ( 'year' => int year, 'month' => int month, 'day' => int day [, 'hour' => int hour, 'min' => int min, 'sec' => int sec )
createdDate=int year, int month, int day [, int hour, int min, int sec ]]
createdDate=array( int year, int month, int day [, int hour, int min, int sec] )
createdDate=array ( 'timestamp' => int timestamp )
createdDate=string datestring, // date in a string, acceptable by strtotime-command, ex. '14 august 2006 16.00.00' (due to strtotime-limitation, dates before 'January 1 1970 00:00:00 GMT'.. .)
xparam 2=array( *[ xparamkey => xparamvalue ] )

example 1

$vevent->setProperty( 'created', 2006, 8, 11, 14, 30, 35 );
// 11 august 2006 14.30.35 UTC

example 2

$vcalendar = new vcalendar();
$vtodo = new vtodo();
.. .
$date = array('year' => 2006, 'month' => 10, 'day' => 10, 'tz' => '+0200');
$date = $vcalendar->validDate( $date, TRUE );
// local date + UTC offset sets UTC format date
$vtodo->setProperty( 'created', $date );
.. .

example 3

$vevent->setProperty( 'created' );
// current UTC date-time is set if called without parameters

[index]

3.2.13 DESCRIPTION

This property provides a more complete description of the calendar component, than that provided by the SUMMARY property (, analogous to a mail BODY).
get DESCRIPTION

format

getProperty( 'DESCRIPTION' )

output = descriptionValue 1

getProperty( 'DESCRIPTION', FALSE , TRUE )

output = array( 'value' => descriptionValue 1
, 'params' => params 2 )

example

$description = $vevent->getProperty( 'description' );

Set DESCRIPTION

format

setProperty( 'description', descriptionValue [, params ] )

descriptionValue 1=Value type TEXT
params 2=array ( ['LANGUAGE' => '<lang>']
[, 'ALTREP' => '<alt.text>']
[, xparam] )
xparam=*[ xparamkey => xparamvalue ]

example

$vevent->setProperty( 'description', 'This is a description' );

[index]

3.2.14 DTEND

This property specifies the date and time that a calendar component ends.
get DTEND

format

getProperty( 'DTEND' )

output = dtendDate 1

getProperty( 'DTEND', FALSE , TRUE )

output = array( 'value' => dtendDate 1
, 'params' => params 2 )

example

$dtend = $vevent->getProperty( 'dtend' );

Set DTEND

format

setProperty( 'dtend', dtendDate [, params ] )

dtendDate 1=array ( 'year' => int year, 'month' => int month, 'day' => int day [, 'hour' => int hour, 'min' => int min, 'sec' => int sec [, 'tz' => mixed tz ]] )
dtendDate=int year, int month, int day [, int hour, int min, int sec[, mixed tz ]]
dtendDate=array( int year, int month, int day [, int hour, int min, int sec[, mixed tz ]] )
dtendDate=array ( 'timestamp' => int timestamp [, 'tz' => mixed tz ] )
dtendDate=string datestring // date in a string, acceptable by strtotime-command, ex. '14 august 2006 16.00.00' (due to strtotime-limitation, dates before 'January 1 1970 00:00:00 GMT'.. .)
dtendDate:Within the "VFREEBUSY" calendar component, the time MUST be specified in the UTC time format.
tz=timezone / UTC offset
offset=(+/-)HHmm[ss], local date + UTC offset sets UTC format date
params 2=array( [ tzidparam / datetimeparam / dateparam ] *[, xparams ] )
tzidparam=timezone identifier // date output as local date-time with timezone identifier
datetimeparam="VALUE" => "DATE-TIME" // date output as date-time
dateparam="VALUE" => "DATE" // date output as date
xparams=xparamkey => xparamvalue

example 1

$vevent->setProperty( 'dtend'
, 2006, 8, 11, 16, 30, 0 );
// 11 august 2006 16.30.00 local date

example 2

$vfreebusy->setProperty( 'dtend'
, 2006, 8, 11, 16, 30, 0, '-040000' );
// 11 august 2006 16.30.00 -040000 : local date + UTC offset sets UTC format date

[index]

3.2.15 DTSTAMP

The property indicates the date/time that the instance of the iCalendar object was created.
get DTSTAMP

format

getProperty( 'DTSTAMP' )

output = dtstampDate 1

getProperty( 'DTSTAMP', FALSE , TRUE )

output = array( 'value' => dtstampDate 1
, 'params' => xparam 2 )

example

$dtstamp = $vevent->getProperty( 'dtstamp' );

Set DTSTAMP
DTSTAMP is AUTO GENERATED at component creation (not in valarm/timzone components).

format

setProperty( 'dtstamp', dtstampDate [, xparam ] )

dtstampDate:MUST be specified in the UTC time format.
dtstampDate 1=array ( 'year' => int year, 'month' => int month, 'day' => int day [, 'hour' => int hour, 'min' => int min, 'sec' => int sec] )
dtstampDate=int year, int month, int day [, int hour, int min, int sec]
dtstampDate=array( int year, int month, int day [, int hour, int min, int sec] )
dtstampDate=array ( 'timestamp' => int timestamp )
dtstampDate=string datestring // date in a string, acceptable by strtotime-command, ex. '14 august 2006 16.00.00' (due to strtotime-limitation, dates before 'January 1 1970 00:00:00 GMT'.. .)
xparam 2=array( *[ xparamkey => xparamvalue ] )

example 1

$vevent->setProperty( 'dstamp'
, 2006, 8, 11, 7, 30, 1 );
// 11 august 2006 07.30.01 UTC

example 2

$vcalendar = new vcalendar();
$vtodo = new vtodo();
.. .
$date = array('year' => 2006, 'month' => 10, 'day' => 10, 'tz' => '+0200');
$date = $vcalendar->validDate( $date, TRUE );
// local date + UTC offset sets UTC format date
$vtodo->setProperty( 'dtstamp', $date );
.. .

[index]

3.2.16 DTSTART

This property specifies when the calendar component begins.
get DTSTART

format

getProperty( 'DTSTART' )

output = dtstartDate 1

getProperty( 'DTSTART', FALSE , TRUE )

output = array( 'value' => dtstartDate 1
, 'params' => params 2 )

example

$dtstart = $vevent->getProperty( 'dtstart' );

Set DTSTART

format

setProperty( 'dtstart', mixed dtstartDate [, params ] )

dtstartDate 1=array ( 'year' => int year, 'month' => int month, 'day' => int day [, 'hour' => int hour, 'min' => int min, 'sec' => int sec[, 'tz' => mixed tz ]] )
dtstartDate=int year, int month, int day [, int hour, int min, int sec[, mixed tz ]]
dtstartDate=array( int year, int month, int day [, int hour, int min, int sec[, mixed tz ]] )
dtstartDate=array ( 'timestamp' => int timestamp [, 'tz' => mixed tz ] )
dtstartDate=string datestring // date in a string, acceptable by strtotime-command, ex. '14 august 2006 16.00.00' (due to strtotime-limitation, dates before 'January 1 1970 00:00:00 GMT'.. .)
dtstartDate:Within the "VFREEBUSY" calendar component, the time MUST be specified in the UTC time format.
tz=timezone / offset
offset=(+/-)HHmm[ss], local date + UTC offset sets UTC format date
params 2=array( [ tzidparam / datetimeparam / dateparam ] *[, xparams ] )
tzidparam=timezone identifier // date output as local date-time with timezone identifier
datetimeparam="VALUE" => "DATE-TIME" // date output as date-time
dateparam="VALUE" => "DATE" // date output as date
xparams=xparamkey => xparamvalue

example 1

$vevent->setProperty( 'dstart'
, 2006, 8, 11, 7, 30, 1 );
// 11 august 2006 07.30.01 local date

example 2

$vevent->setProperty( 'dstart'
, 2006, 8, 11, 16, 30, 0, '-040000' );
// 11 august 2006 16.30.00 -040000 : local date + UTC offset sets UTC format date

[index]

3.2.17 DUE

This property defines the date and time that a to-do is expected to be completed.
get DUE

format

getProperty( 'DUE' )

output = dueDate 1

getProperty( 'DUE', FALSE , TRUE )

output = array( 'value' => dueDate 1
, 'params' => params 2 )

example

$due = $vtodo->getProperty( 'due' );

Set DUE

format

setProperty( 'due', mixed dueDate [, params ] )

dueDate 1=array ( 'year' => int year, 'month' => int month, 'day' => int day [, 'hour' => int hour, 'min' => int min, 'sec' => int sec[, 'tz' => mixed tz ]] )
dueDate=int year, int month, int day [, int hour, int min, int sec[, mixed tz ]]
dueDate=array( int year, int month, int day [, int hour, int min, int sec[, mixed tz ]] )
dueDate=array ( 'timestamp' => int timestamp [, 'tz' => mixed tz ] )
dueDate=string datestring // date in a string, acceptable by strtotime-command, ex. '14 august 2006 16.00.00' (due to strtotime-limitation, dates before 'January 1 1970 00:00:00 GMT'.. .)
tz=timezone / offset
offset=(+/-)HHmm[ss], local date + UTC offset sets UTC format date
params 2=array( [ tzidparam / datetimeparam / dateparam ] *[, xparams ] )
tzidparam=timezone identifier // date output as local date-time with timezone identifier
datetimeparam="VALUE" => "DATE-TIME" // date output as date-time
dateparam="VALUE" => "DATE" // date output as date
xparams=xparamkey => xparamvalue

example 1

$vtodo->setProperty( 'due'
, 2006, 8, 11, 18, 0, 0 );
// 11 august 2005 18.00.00 local date

example 2

$vtodo->setProperty( 'due'
, 2006, 8, 11, 16, 30, 0, '-040000' );
// 11 august 2006 16.30.00 -040000 : local date + UTC offset sets UTC format date

[index]

3.2.18 DURATION

The property specifies a positive duration of time.
get DURATION

format

getProperty( 'DURATION' )

output = duration 1

getProperty( 'DURATION', FALSE , TRUE )

output = array( 'value' => duration 1
, 'params' => xparam 2 )

example

$duration = $vtodo->getProperty( 'duration' );

option

If a 4th argument is used and set to TRUE, returned output is in a date output format (like DTEND/DUE), based on DTSTART value with added DURATION value, se output, getProperty( 'DTEND' ) or output, getProperty( 'DUE' )
Set DURATION

format

setProperty( 'duration', mixed duration [, xparam ] )

duration 1=array ( 'week' => int week/false [, 'day' => int day/false [, 'hour' => int hour/false, 'min' => int min/false, 'sec' => int sec/false ]] );
duration=array ( 'week' => int week );
duration=array ( 'day' => int week );
duration=array ( 'hour' => int hour, 'min' => int min, 'sec' => int sec );
duration=array ( 'sec' => int sec );
duration=int week/false [, int day/false [, int hour, int min, int sec]]
duration=array( int week/false [, int day/false [, int hour, int min, int sec]] )
duration=string dur-value = ["+"] "P" (dur-date / dur-time / dur-week)
dur-date=dur-day [dur-time]
dur-time="T" (dur-hour / dur-minute / dur-second)
dur-week=1*DIGIT "W"
dur-hour=1*DIGIT "H" [dur-minute]
dur-minute=1*DIGIT "M" [dur-second]
dur-second=1*DIGIT "S"
dur-day=1*DIGIT "D"
xparam 2=array( *[ xparamkey => xparamvalue ] )

example 1

$vtodo->setProperty( 'duration
, array( 'day' => 1 )); // one day

example 2

$vtodo->setProperty( 'duration
, 'PT4H' ); // four hours

[index]

3.2.19 EXDATE

This property defines the list of date/time exceptions for a recurring calendar component.
get EXDATE

format

getProperty( 'EXDATE' )

output = exdates 1

getProperty( 'exdate', int propOrderNo/FALSE, TRUE )

output = array( 'value' => exdates 1
, 'params' => params 2 )

example

$exdate = $vtodo->getProperty( 'exdate' );

set EXDATE

format

setProperty( 'exdate', exdates [, params ] )

exdates 1=array ( date *[, date ] )
date=array( int year, int month, int day [, int hour, int min, int sec, mixed tz ]] )
date 1=array ( 'year' => int year, 'month' => int month, 'day' => int day [, 'hour' => int hour, 'min' => int min, 'sec' => int sec [, 'tz => mixed tz ]] )
date=array ( 'timestamp' => int timestamp [, 'tz' => mixed tz ] )
date=string datestring // date in a string, acceptable by strtotime-command, ex. '14 august 2006 16.00.00' (due to strtotime-limitation, dates before 'January 1 1970 00:00:00 GMT'.. .)
tz=timezone / offset
offset=(+/-)HHmm[ss], local date + UTC offset sets UTC format date
params 2=array( [ ( datetimeparam/ dateparam ) / tzidparam ] [, xparam] )
datetimeparam="VALUE" => "DATE-TIME" // date output as date-time
dateparam="VALUE" => "DATE" // date output as date
tzidparam="TZID" => text
xparam=*[ xparamkey => xparamvalue ]

example

$vevent->setProperty( 'exdate'
, array( 2006, 8, 14, 16, 0, 0 ));
// 14 august 2006 16.00.00 local date

[index]

3.2.20 EXRULE

This property defines a rule or repeating pattern for an exception to a recurrence set.
get EXRULE

format

getProperty( 'EXRULE' )

output = recur 1

getProperty( 'exrule', int propOrderNo/FALSE, TRUE )

output = array( 'value' => recur 1
, 'params' => xparam 2 )

example

$exrule = $vtodo->getProperty( 'exrule' );

Set EXRULE

format

setProperty( 'exrule', recur [, xparam ] )

format

See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.

recur 1=array( "FREQ"=>freq
either UNTIL or COUNT may appear in a 'recur',
but UNTIL and COUNT MUST NOT occur in the same 'recur'
[, "UNTIL""=>"enddate ]
[, "COUNT""=>"1*DIGIT ]
the rest of these keywords are optional,
but MUST NOT occur more than once
[, "INTERVAL""=>"1*DIGIT ]
[, "BYSECOND""=>"byseclist ]
[, "BYMINUTE""=>"byminlist ]
[, "BYHOUR""=>"byhrlist ]
[, "BYDAY""=>"bywdaylist ]
[, "BYMONTHDAY""=>"bymodaylist ]
[, "BYYEARDAY""=>"byyrdaylist ]
[, "BYWEEKNO""=>"bywknolist ]
[, "BYMONTH""=>"bymolist ]
[, "BYSETPOS""=>"bysplist ]
[, "WKST""=>"weekday ]
[, x-name"=>"text ]
)
freq="SECONDLY" / "MINUTELY" / "HOURLY" / "DAILY" / "WEEKLY" / "MONTHLY" / "YEARLY"
enddate=date
enddate=/ date-time;An UTC value
byseclist=seconds
byseclist=array (seconds / ( seconds *("," seconds) ))
seconds=1DIGIT / 2DIGIT;0 to 59
byminlist=minutes
byminlist=array( minutes / ( minutes *("," minutes) ))
minutes=1DIGIT / 2DIGIT;0 to 59
byhrlist=hour
byhrlist=array( hour / ( hour *("," hour) ))
hour=1DIGIT / 2DIGIT;0 to 23
bywdaylist=weekdaynum
bywdaylist=array( weekdaynum / ( weekdaynum *("," weekdaynum) ))
weekdaynum=[([plus] ordwk / minus ordwk)] weekday
plus="+"
minus="-"
ordwk=1DIGIT / 2DIGIT;1 to 53
weekday="SU" / "MO" / "TU" / "WE" / "TH" / "FR" / "SA"
   ;Corresponding to SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY,
   ;FRIDAY, SATURDAY and SUNDAY days of the week.
bymodaylist=monthdaynum
bymodaylist=aray( monthdaynum / ( monthdaynum *("," monthdaynum) ))
monthdaynum=([plus] ordmoday) / (minus ordmoday)
ordmoday=1DIGIT / 2DIGIT;1 to 31
byyrdaylist=yeardaynum
byyrdaylist=array( yeardaynum / ( yeardaynum *("," yeardaynum) ))
yeardaynum=([plus] ordyrday) / (minus ordyrday)
ordyrday=1DIGIT / 2DIGIT / 3DIGIT;1 to 366
bywknolist=weeknum
bywknolist=array( weeknum / ( weeknum *("," weeknum) ))
weeknum=([plus] ordwk) / (minus ordwk)
bymolist=monthnum
bymolist=array( monthnum / ( monthnum *("," monthnum) ))
monthnum=1DIGIT / 2DIGIT;1 to 12
bysplist=setposday
bysplist=array( setposday / ( setposday *("," setposday) ))
setposday=yeardaynum
xparam 2=array( *[ xparamkey => xparamvalue ] )

example

$vevent->setProperty( 'Exrule'
, array( 'FREQ'=>"MONTHLY"
', UNTIL'=>'20060831'// date / date-time in UTC format; string/array, see CREATED format
, 'INTERVAL'=>2
, 'WKST'=>'SU'
, 'BYSECOND'=>2
, 'BYMINUTE'=>array( 2, -4, 6 )// single value/array of values
, 'BYHOUR'=>array( 2, 4, -6 )// single value/array of values
, 'BYMONTHDAY'=>-2// single value/array of values
, 'BYYEARDAY'=>2// single value/array of values
, 'BYWEEKNO'=>array( 2, -4, 6 )// single value/array of values
, 'BYMONTH'=>2// single value/array of values
, 'BYSETPOS'=>array( 2, -4, 6 )// single value/array of values
, 'BYday'=>array
(array(-2,'DAY'=>'WE')
,array( 3,'DAY'=>'TH')
,array( 5,'DAY'=>'FR')
,array( 'DAY'=>'MO'))
// array of value arrays
// (or single value array)
, 'X-NAME'=>'x-value' )
, array( 'xparamkey'=>'xparamValue' ))
$vtodo->setProperty( 'exrule'
, array('FREQ'=>"WEEKLY"
,'COUNT'=>2
,'INTERVAL'=>2
,'WKST'=>'SU'
,'BYSECOND'=>array( -2, 4, 6 )// single value/array of values
,'BYMINUTE'=>-2// single value/array of values
,'BYHOUR'=>2// single value/array of values
,'BYMONTHDAY'=>array( 2, -4, 6 )// single value/array of values
,'BYYEARDAY'=>array( -2, 4, 6 )// single value/array of values
,'BYWEEKNO'=>-2// single value/array of values
,'BYMONTH'=>array( 2, 4, -6 )// single value/array of values
,'BYSETPOS'=>-2// single value/array of values
,'BYday'=>array(5,'DAY'=>'WE')// single value array
// (or array of value arrays)
,'X-NAME'=>'x-value' ));

[index]

3.2.21 FREEBUSY

The property defines one or more free or busy time intervals in a VFREEBUSY calendar component
get FREEBUSY

format

getProperty( 'FREEBUSY' )

output = array( 'fbtype' => freebusytype 1 *[, dateperiods 2] )

getProperty( 'FREEBUSY', int propOrderNo/FALSE , TRUE )

output = array( 'value' => array('fbtype' => freebusytype 1 *[,dateperiods 2])
, 'params' => xparam 3 )

example

$freebusy = $vfreebusy->getProperty( 'FREEBUSY' );

Set FREEBUSY

format

setProperty( 'freebusy', freebusytype, dateperiods [, xparam ] )

freebusytype 1=one of "FREE" / "BUSY" Default / "BUSY-UNAVAILABLE" / "BUSY-TENTATIVE" / x-name
dateperiods 2=array( array( startdate, enddate/duration )  *[, array( startdate, enddate/duration ) ] )
startdate
enddate
=array( int year, int month, int day, int int hour, int min, int day [, string offset ] )
startdate
enddate
=array ( 'year' => int year, 'month' => int month, 'day' => int day, 'hour' => int hour, 'min' => int min, 'sec' => int sec [, 'tz' => string offset ] ) // output format
startdate
enddate
=array ( 'timestamp' => int timestamp [, 'tz' => string offset ] )
startdate
enddate
=string datestring // date in a string, acceptable by strtotime-command, ex. '14 august 2006 16.00.00' (due to strtotime-limitation, dates before 'January 1 1970 00:00:00 GMT'.. .)
startdate
enddate
:date and time values MUST be in an UTC time format or local date + UTC offset.
offset=(+/-)HHmm[ss], local date + UTC offset sets UTC format date
duration=array( int week/false [, int day/false, int hour, int min, int sec] )
duration=array ( 'week' => int week/false [, 'day' => int day/false [, 'hour' => int hour, 'min' => int min, 'sec' => int sec ]] ); // output format
duration=array ( 'week' => int week );
duration=array ( 'day' => int day );
duration=array ( 'hour' => int hour, 'min' => int min, 'sec' => int sec );
duration=array ( 'sec' => int sec );
duration=string dur-value = (["+"] / "-") "P" (dur-date / dur-time / dur-week)
dur-date=dur-day [dur-time]
dur-time="T" (dur-hour / dur-minute / dur-second)
dur-week=1*DIGIT "W"
dur-hour=1*DIGIT "H" [dur-minute]
dur-minute=1*DIGIT "M" [dur-second]
dur-second=1*DIGIT "S"
dur-day=1*DIGIT "D"
xparam 3=array( *[ xparamkey => xparamvalue ] )

example

See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.

$fdate1 = array ( 2001, 1, 1, 1, 1, 1 );
alt.
$fdate1 = array ( 'year' => 2001, 'month' => 1, 'day' => 1, 'hour' => 1, 'min' => 1, 'sec' => 1 );
$fdate2 = array ( 2002, 2, 2, 2, 2, 2 );
$fdate3 = array ( 2003, 3, 3, 3, 3, 3 );
$fdate4 = '4 April 2005 4:4:4';
$fdate7 = array ( 'year' => 2007, 'month' => 7, 'day' => 7 );
$fdur6 = array ( 'week' => 0, 'day' => 5, 'hour' => 5, 'min' => 5, 'sec' => 5 );
$fdur7 = array ( 0, 0, 6 ); // duration for 6 hours
$fdur8 = 'P2D'; // duration two days

$freebusy->setProperty( 'freebusy'
, 'FREE
,array(array( $fdate1, $fdate2 )
,array( $fdate3, $fdur6 )
,array( $fdate4, $fdate5 )));
$freebusy->setProperty( 'freebusy'
, 'Busy'
,array( array( array( $fdate1, $fdate2 )
,array( $fdate3, $fdur8 )
,array( $fdate4, $fdur7 )
,array( $fdate1, $fdate3 )));
[index]

3.2.22 GEO

This property specifies information related to the global position for the activity specified by a calendar component.
get GEO

format

getProperty( 'GEO' )

output = array( 'latitude' => <latitude>
, 'longitude' => <longitude>))

getProperty( 'GEO', FALSE , TRUE )

output = array( 'value' => array( 'latitude' => <latitude>
, 'longitude' => <longitude>))
, 'params' => xparam 1 )

example

$geo = $vevent->getProperty( 'GEO' );

Set GEO

format

setProperty( 'geo', float latitude, float longitude [, xparam ] )

xparam 1=array( *[ xparamkey => xparamvalue ] )

example

$vevent->setProperty( 'geo', 11.23456, -23.45678 );

[index]

3.2.23 LAST-MODIFIED

The property specifies the date and time that the information associated with the calendar component was last revised in the calendar store.
get LAST-MODIFIED

format

getProperty( 'LAST-MODIFIED' )

output = moddate 1

getProperty( 'LAST-MODIFIED', FALSE , TRUE )

output = array( 'value' => moddate 1
, 'params' => xparam 2 )

example

$last-mod = $vevent->getProperty( 'LAST-MODIFIED' );

Set LAST-MODIFIED
The property value MUST be specified in the UTC time format.

format

setProperty( 'Last-Modified' [, moddate [, xparam ]] )

moddate 1=array ( 'year' => int year, 'month' => int month, 'day' => int day [, 'hour' => int hour, 'min' => int min, 'sec' => int sec ] )
moddate=int year, int month, int day [, int hour, int min, int sec ]
moddate=array( int year, int month, int day [, int hour, int min, int sec ] )
moddate=array ( 'timestamp' => int timestamp )
moddate=string datestring // date in a string, acceptable by strtotime-command, ex. '14 august 2006 16.00.00' (due to strtotime-limitation, dates before 'January 1 1970 00:00:00 GMT'.. .)
xparam 2=array( *[ xparamkey => xparamvalue ] )

example 1

$vevent->setProperty( 'last-modified'
, 2006, 8, 14, 12, 1, 2 );
// 14 august 2006 12.01.02 UTC

example 2

$vcalendar = new vcalendar();
$vtodo = new vtodo();
.. .
$date = array('year' => 2006, 'month' => 10, 'day' => 10, 'tz' => '+0200');
$date = $vcalendar->validDate( $date, TRUE ); // local date + UTC offset sets UTC format date
$vtodo->setProperty( 'last-modified', $date );
.. .

example 3

$vevent->setProperty( 'last-modified' );
// current UTC date-time is set if called without parameters

[index]

3.2.24 LOCATION

The property defines the intended venue for the activity defined by a calendar component.
get LOCATION

format

getProperty( 'LOCATION' )

output = location 1

getProperty( 'LOCATION', FALSE , TRUE )

output = array( 'value' => location 1
, 'params' => param 2 )

example

$location = $vevent->getProperty( 'LOCATION' );

Set LOCATION

format

setProperty( 'location', string location [, array param] )

location 1=Value type TEXT
params 2=array( ['LANGUAGE' => '<lang>']
[, 'ALTREP' => '<alt.text>']
[, xparam]
xparam=*[ xparamkey => xparamvalue ]

example

$vevent->setProperty( 'location', 'Buckingham Palace' );

[index]

3.2.25 ORGANIZER

The property defines the organizer for a calendar component.
get ORGANIZER

format

getProperty( 'ORGANIZER' )

output = organizer 1

getProperty( 'ORGANIZER', FALSE , TRUE )

output = array( 'value' => organizer 1
, 'params' => params 2 )

example

$organizer = $vevent->getProperty( 'ORGANIZER' );

Set ORGANIZER

format

setProperty( 'organizer', organizer [, params] )

organizer 1=a calendar user address, a URI as defined by [RFC 1738] or any other IANA registered form for a URI.
params 2=array( ['LANGUAGE' => '<lang>' (applies to the CN parameter value) ]
[, 'CN' => 'common name to be associated with the calendar user specified by the property']
[, 'DIR' => 'reference to a directory entry associated with the calendar user specified by the property' ]
[, 'SENT-BY' => 'single calendar user that is acting on behalf of the calendar user specified by the property' ]
[, xparam ]
xparam=*[ xparamkey => xparamvalue ]

example

$vevent->setProperty( 'organizer'
'ical@domain.com'
array( 'CN'=>'John Doe'
'DIR'=> 'ldap://host.com:6666/o=3DDC%20Associates,c=3DUS??(cn=3DJohn%20Smith)'
'SENT-BY'=>'secretary@domain.com'
'x-Key1'=>'x-Value'
'x-Key2'=>'y-Value' ));

[index]

3.2.26 PERCENTCOMPLETE

This property is used by an assignee or delegatee of a to-do to convey the percent completion of a to-do to the Organizer. The property value is a positive integer between zero and one hundred. A value of "0" indicates the to-do has not yet been started. A value of "100" indicates that the to-do has been completed. Integer values in between indicate the percent partially complete.
get PERCENT-COMPLETE

format

getProperty( 'PERCENT-COMPLETE' )

output = percent 1

getProperty( 'PRIORITY', FALSE , TRUE )

output = array( 'value' => percent 1
, 'params' => xparam 2 )

example

$percent = $vtodo->getProperty( 'PERCENT-COMPLETE' );

Set PERCENT-COMPLETE

format

setProperty( 'Percent-Complete', percent [, xparam ] )

percent 1=Value type INTEGER
xparam 2=array( *[ xparamkey => xparamvalue ] )

example

$vtodo->setProperty( 'percent-complete', 90 );

[index]

3.2.27 PRIORITY

The property defines the relative priority for a calendar component. The priority is specified as an integer in the range zero to nine. A value of zero (US-ASCII decimal 48) specifies an undefined priority. A value of one (US-ASCII decimal 49) is the highest priority. A value of two (US-ASCII decimal 50) is the second highest priority. Subsequent numbers specify a decreasing ordinal priority. A value of nine (US-ASCII decimal 58) is the lowest priority.
get PRIORITY

format

getProperty( 'PRIORITY' )

output = priority 1

getProperty( 'PRIORITY', FALSE , TRUE )

output = array( 'value' => priority 1
, 'params' => xparam 2 )

example

$priority = $vevent->getProperty( 'priority' );

Set PRIORITY

format

setProperty( 'priority', priority [, xparam ] )

priority 1=Value type INTEGER
xparam 2=array( *[ xparamkey => xparamvalue ] )

example

$vevent->setProperty( 'priority', 3 );

[index]

3.2.28 RDATE

This property defines the list of date/times for a recurrence set.
get RDATE

format

getProperty( 'RDATE' )

output = dates 1

getProperty( 'RDATE', int propOrderNo/FALSE , TRUE )

output = array( 'value' => dates 1
, 'params' => params 2 )

example

$rdates = $vevent->getProperty( 'RDATE' );

Set RDATE

format

setProperty( 'rdate', dates [, params ] )

dates 1=array ( date2 *[, date2 ] )
date2=date
date2=array( startdate, enddate/duration ) ]
startdate=date
enddate=date
date=array( int year, int month, int day [, int int hour, int min, int day, mixed tz ] )
date=array ( 'year' => int year, 'month' => int month, 'day' => int day [, 'hour' => int hour, 'min' => int min, 'sec' => int sec [, 'tz => mixed tz ]] ) // output format
date=array ( 'timestamp' => int timestamp [, 'tz' => mixed tz ] )
date=string datestring
// date in a string, acceptable by strtotime-command, ex. '14 august 2006 16.00.00' (due to strtotime-limitation, dates before 'January 1 1970 00:00:00 GMT'.. .)
tz=timezone / offset
offset=(+/-)HHmm[ss], local date + UTC offset sets UTC format date
duration=array( int week/false [, int day/false, int hour, int min, int sec] )
duration=array ( 'week' => int week/false [, 'day' => int day/false [, 'hour' => int hour, 'min' => int min, 'sec' => int sec ]] ); // output format
duration=array ( 'week' => int week );
duration=array ( 'day' => int week );
duration=array ( 'hour' => int hour, 'min' => int min, 'sec' => int sec );
duration=array ( 'sec' => int sec );
params 2=array( [ ( tzidparam / datetimeparam / dateparam ) / periodparam ] *[, xparams ] )
tzidparam=timezone identifier // date output as local date-time with timezone identifier
datetimeparam="VALUE" => "DATE-TIME" // date output as date-time
dateparam="VALUE" => "DATE" // date output as date
periodparam="VALUE" => "PERIOD" // date output as period
xparams=xparamkey => xparamvalue

example

See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.

// $rdate1 = array ( 2001, 1, 1, 1, 1, 1 );
// alt.
$rdate1 = array ( 'year' => 2001, 'month' => 1, 'day' => 1, 'hour' => 1, 'min' => 1, 'sec' => 1, 'tz' => 'GMT' );
$rdate2 = array ( 2002, 2, 2, 2, 2, 2, 'GMT' );
$rdate3 = '3 March 2003 03.03.03';
$rdate4 = array ( 2004, 4, 4, 4, 4, 4, 'GMT' );
$rdate5 = array ( 2005, 10, 5, 5, 5, 5 );
$rdur6 = array ( 'week' => 0, 'day' => 0, 'hour' => 5, 'min' => 5, 'sec' => 5 );
$rdur7 = array ( 0, 0, 6 );
// duration for 6 hours
$rdate8 = array ( 'year' => 2007, 'month' => 7, 'day' => 7 );

$vevent = new vevent();
$vevent->setProperty( 'rdate',  array( $rdate1 ));
// one recurrence date, date in 7-params format
$vevent->setProperty( 'rdate', array( $rdate1, $rdate2 ));
// two dates, date 7-params format
$vevent->setProperty( 'rdate',  array( array( $rdate1, $rdate5 )
// Both fromdate and tomdate must have 7 params !!!
, array( $rdate2, $rdur6 )
// duration
, array( $rdate3, $rdur7 )
// period, pairs of fromdate <-> tom -date/-duration
, array( $rdate4, $rdate5 )
));

[index]

3.2.29 RECURRENCE-ID

This property is used in conjunction with the UID and SEQUENCE property to identify a specific instance of a recurring VEVENT, VTODO or VJOURNAL calendar component. The property value is the effective value of the DTSTART property of the recurrence instance.
get RECURRENCE-ID

format

getProperty( 'RECURRENCE-ID' )

output = recurrIdDate 1

getProperty( 'RECURRENCE-ID', FALSE , TRUE )

output = array( 'value' => recurrIdDate 1
, 'params' => params 2 )

example

$recurrDate = $vtodo->getProperty( 'RECURRENCE-ID' );

Set RECURRENCE-ID

format

setProperty( 'recurrence-id', recurrIdDate [, params ] )

recurrIdDate 1=array ( 'year' => int year, 'month' => int month, 'day' => int day [, 'hour' => int hour, 'min' => int min, 'sec' => int sec [, 'tz' => mixed tz ]] )
recurrIdDate=int year, int month, int day [, int hour, int min, int sec [, mixed tz ]]
recurrIdDate=array( int year, int month, int day [, int hour, int min, int sec [, mixed tz ]] )
recurrIdDate=array ( 'timestamp' => int timestamp [, 'tz' => mixed tz ] )
recurrIdDate=string datestring // date in a string, acceptable by strtotime-command, ex. ̈́'14 august 2006 16.00.00' (due to strtotime-limitation, dates before 'January 1 1970 00:00:00 GMT'.. .)
tz=timezone / offset
offset=(+/-)HHmm[ss], local date + UTC offset sets UTC format date
params 2=array( [ datetimeparam / dateparam ][, rangeparam ][, xparam ] )
datetimeparam="VALUE" => "DATE-TIME" // date output as date-time
dateparam="VALUE" => "DATE" // date output as date
rangeparam="RANGE" => ( "THISANDPRIOR" / "THISANDFUTURE" ) // range parameter
xparam=*[ xparamkey => xparamvalue ]

example

$vtodo->setProperty( 'recurrence-id', '3 March 2003 03.03.03' );

[index]

3.2.30 RELATED-TO

The property is used to represent a relationship or reference between one calendar component and another. The property value consists of the persistent, globally unique identifier of another calendar component. This value would be represented in a calendar component by the UID property.
get RELATED-TO

format

getProperty( 'RELATED-TO' )

output = relid 1

getProperty( 'RELATED-TO', int propOrderNo/FALSE , TRUE )

output = array( 'value' => relid 1
, 'params' => params 2 )

example

$relatedId = $vtodo->getProperty( 'RELATED-TO' );

Set RELATED-TO

format

setProperty( 'Related-To', relid [, params ] )

relid 1=Value type TEXT.
params 2=array( [ reltype ] [, xparam] )
reltype='RELTYPE' => ('PARENT' (Default) / 'CHILD' / 'SIBLING' / iana-token / x-name)
xparam=*[ xparamkey => xparamvalue ]

example

$vtodo->setProperty( 'related-to', '19960401-080045-4000F192713@host.com');

[index]

3.2.31 REPEAT

This property defines the number of time the alarm should be repeated, after the initial trigger. If the alarm triggers more than once, then this property MUST be specified along with the DURATION property.
get REPEAT

format

getProperty( 'REPEAT' )

output = repeatTimes 1

getProperty( 'REPEAT', FALSE , TRUE )

output = array( 'value' => repeatTimes 1
, 'params' => xparam 2 )

example

$repeat = $vtodo->getProperty( 'REPEAT' );

Set REPEAT

format

setProperty( 'repeat', repeatTimes [, xparam ] )

repeatTimes 1=>Value type INTEGER
xparam 2=>array( *[ xparamkey => xparamvalue ] )

example

$valarm->setProperty( 'repeat', 2 );

[index]

3.2.32 REQUEST-STATUS

This property defines the status code returned for a scheduling request.
get REQUEST-STATUS

format

getProperty( 'REQUEST-STATUS' )

output = array( 'statcode' => statcode 1
, 'text' => errtext 2
[ , 'extdata' => extraData 3 ] )

getProperty( 'REQUEST-STATUS', int propOrderNo/FALSE, TRUE )

output = array( 'value' =>array( 'statcode' => statcode 1
, 'text' => errtext 2
[ , 'extdata' => extraData 3 ] )
, 'params' => params 4 )

example

$requestStatus = $vtodo->getProperty( 'REQUEST-STATUS' );

Set REQUEST-STATUS

format

setProperty( 'Request-Status'
, statcode, errtext [, extraData/FALSE [, params ]] )
statcode 1=Hierarchical, numeric return status code (1*DIGIT *("." 1*DIGIT))
errtext 2=Textual status description
extraData 3=Textual exception data. For example, the offending property name and value or complete property line.
params 4=array( ['LANGUAGE' => '<lang>'] [, xparam ] )
xparam=*[ xparamkey => xparamvalue ]

example

$vfreebusy->setProperty('request-status'
, 2.00
, 'Invalid property value'
, 'DTSTART:96-Apr-31');

[index]

3.2.33 RESOURCES

This property defines the equipment or resources anticipated for an activity specified by a calendar entity.
get RESOURCES

format

getProperty( 'RESOURCES' )

output = resources 1

getProperty( 'RESOURCES', int propOrderNo/FALSE, TRUE )

output = array( 'value' => resources 1
, 'params' => params 2 )

example

$resources = $vtodo->getProperty( 'RESOURCES' );

Set RESOURCES

format

setProperty( 'resources', resources [, params ] )

resources 1=string resourceParts (commaseparated list if more than one )
resources=array( string resourcePart1 *[, string resourcePartN ] )
params 2=array( ['LANGUAGE' => '<lang>'] )
[, 'ALTREP' => '<alt.text>']
[, xparam]
xparam=*[ xparamkey => xparamvalue ]

example

$vevent->setProperty( 'resources', 'COMPUTER PROJECTOR' );

[index]

3.2.34 RRULE

This property defines a rule or repeating pattern for recurring events, to-dos, or timezone definitions.
get RRULE

format

getProperty( 'RRULE' )

output = recur 1

getProperty( 'RRULE', int propOrderNo/FALSE, TRUE )

output = array( 'value' => recur 1
, 'params' => xparam 2 )

example

$rrules = $vtodo->getProperty( 'RRULE' );

Set RRULE

format

setProperty( 'rrule', recur [, xparam ] )

For rules example see Exrule format and in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.

recur 1=see Exrule
xparam 2=array( *[ xparamkey => xparamvalue ] )

[index]

3.2.35 SEQUENCE

This property defines the revision sequence number of the calendar component within a sequence of revisions.
It is monotonically incremented by the ORGANIZER's CUA each time the ORGANIZER makes a significant revision to the calendar component. When the ORGANIZER makes changes to one of the following properties, the sequence number MUST be incremented: DTSTART, DTEND, DUE, RDATE, RRULE, EXDATE, EXRULE, STATUS. In addition, changes made by the ORGANIZER to other properties can also force the sequence number to be incremented. The ORGANIZER CUA MUST increment the sequence number when ever it makes changes to properties in the calendar component that the ORGANIZER deems will jeopardize the validity of the participation status of the Attendees. For example, changing the location of a meeting from one locale to another distant locale could effectively impact the participation status of the Attendees.
get SEQUENCE

format

getProperty( 'SEQUENCE' )

output = sequence 1

getProperty( 'SEQUENCE', FALSE , TRUE )

output = array( 'value' => sequence 1
, 'params' => xparam 2 )

example

$sequence = $vtodo->getProperty( 'SEQUENCE' );

Set SEQUENCE

format

setProperty( 'sequence'[, sequence [, xparam ]] )

sequence 1=Value type INTEGER
xparam 2=array( *[ xparamkey => xparamvalue ] )

example

$vevent->setProperty( 'sequence', 2 );
$vevent->setProperty( 'sequence' );
// force sequence number to be set to 1 or, if sequence exists, incremented by 1

[index]

3.2.36 STATUS

This property defines the overall status or confirmation for the calendar component.
get STATUS

format

getProperty( 'STATUS' )

output = status 1

getProperty( 'STATUS', FALSE , TRUE )

output = array( 'value' => status 1
, 'params' => xparam 2 )

example

$status = $vtodo->getProperty( 'STATUS' );

Set STATUS

format

setProperty( 'status', status [, xparam ] )

status 1=  "TENTATIVE";Indicates event is tentative
/ "CONFIRMED";Indicates event is definite
/ "CANCELLED";Indicates event was cancelled
;Status values for a "VEVENT"
statvalue=  "NEEDS-ACTION";Indicates to-do needs action
/ "COMPLETED";Indicates to-do completed
/ "IN-PROCESS";Indicates to-do in process of
/ "CANCELLED";Indicates to-do was cancelled
;Status values for "VTODO"
statvalue=  "DRAFT";Indicates journal is draft
/ "FINAL";Indicates journal is final
/ "CANCELLED";Indicates journal is removed
;Status values for "VJOURNAL"
xparam 1=array( *[ xparamkey => xparamvalue ] )

example

$vevent->setProperty( 'Status', 'COMPLETED' );

[index]

3.2.37 SUMMARY

This property defines a short summary or subject for the calendar component. (In 'rfc2445, Recommended Practices', up to 255 characters) (, analogous to a mail SUBJECT)
get SUMMARY

format

getProperty( 'SUMMARY' )

output = summary 1

getProperty( 'SUMMARY', FALSE , TRUE )

output = array( 'value' => summary 1
, 'params' => params 2 )

example

$summary = $vtodo->getProperty( 'SUMMARY' );

Set SUMMARY

format

setProperty( 'summary', summary [, params ] )

summary 1=Value type TEXT, a short, one line summary about the activity or journal entry.
params 2=array( ['LANGUAGE' => '<lang>']
[, 'ALTREP' => '<alt.text>']
[, xparam ] )
xparam=*[ xparamkey => xparamvalue ]

example

$vevent->setProperty( 'summary', 'This is a summary' );

[index]

3.2.38 TRANSP

This property defines whether an event is transparent or not to busy time searches.
get TRANSP

format

getProperty( 'TRANSP' )

output = transp 1

getProperty( 'TRANSP', FALSE , TRUE )

output = array( 'value' => transp 1
, 'params' => xparam 2 )

example

$transp = $vtodo->getProperty( 'TRANSP' );

Set TRANSP

format

setProperty( 'transp', transp [, xparam ] )

transp 1="OPAQUE" / "TRANSPARENT"
xparam 2=array( *[ xparamkey => xparamvalue ] )

example

$vevent->setProperty( 'transp', 'TRANSPARENT' );

[index]

3.2.39 TRIGGER

This property specifies when an alarm will trigger. The default value type is DURATION. The value type can be set to a DATE-TIME value type, in which case the value MUST specify a UTC formatted DATE-TIME value.
get TRIGGER

format

getProperty( 'TRIGGER' )

output = duration/date

getProperty( 'TRIGGER', FALSE , TRUE )

output= array( 'value' => duration/date )
, 'params' => xparams )
duration= array( 'week' => int week, 'relatedstart' => bool relstart, 'before' => bool before )
duration= array( 'day' => int day, 'hour' => int hour, 'min' => int min, 'sec' => int sec, 'relatedstart' => bool relstart, 'before' => bool before )
relstart= TRUE : related start, FALSE : related end
before= TRUE : before relstart, FALSE : after relstart
date= array( 'year' => int year, 'month' => int month [, 'week' => int week ] , 'day' => int day [, 'hour' => int hour, 'min' => int min, 'sec' => int sec, 'tz' => string offset ]
xparams= array( *[ xparamkey => xparamvalue ] )

example

$trigger = $vtodo->getProperty( 'TRIGGER' );

Set TRIGGER

format

setProperty( 'trigger', duration [,bool relatedEnd=FALSE [,bool after=FALSE [, param ]]])

setProperty( 'trigger', duration2 [, param ])

setProperty( 'trigger', date [, param ] )

setProperty( 'trigger', int year/FALSE, int month/FALSE, int day/FALSE [, int week/FALSE [, int hour/FALSE, int min/FALSE, int sec/FALSE [, bool relatedEnd=FALSE [, bool after=FALSE [, string offset/FALSE [, array xparam ]]]]]] )

duration=array ( 'week' => int week )
duration=array ( 'day' => int day [, 'hour' => int hour, 'min' => int min, 'sec' => int sec ] )
duration2=string dur-value = (["+"] / "-") "P" (dur-date / dur-time / dur-week)
dur-date=dur-day [dur-time]
dur-time="T" (dur-hour / dur-minute / dur-second)
dur-week=1*DIGIT "W"
dur-hour=1*DIGIT "H" [dur-minute]
dur-minute=1*DIGIT "M" [dur-second]
dur-second=1*DIGIT "S"
dur-day=1*DIGIT "D"
date 1=array ( 'year' => int year, 'month' => int month, 'day' => int day [, 'hour' => int hour, 'min' => int min, 'sec' => int sec, 'tz' => string offset ] )
date=array ( 'timestamp' => int timestamp [, 'tz' => string offset ] )
offset=(+/-)HHmm[ss], local date + UTC offset sets UTC format date
date=string datestring
// UTC date in a string, acceptable by strtotime-command, ex. '14 august 2006 16.00.00' (due to strtotime-limitation, dates before 'January 1 1970 00:00:00 GMT'.. .)
param=array( [[ reltype ] / [ datetimeparam ]] [, xparams ] )
reltyp='RELATED' => 'START' (default) / 'END'
datetimeparam='VALUE' => 'DATE-TIME'
xparam=*[ xparamkey => xparamvalue ]

example 1

$valarm->setProperty( 'trigger'
, FALSE, FALSE, FALSE, FALSE, 1, 2, 3, TRUE, TRUE );
// alt.
$valarm->setProperty( 'trigger'
, array ('hour'=>1,'min'=>2,'sec'=>3),TRUE,TRUE);
// alt.
$valarm->setProperty( 'trigger'
, 'PT1H2M3S', array ( 'related' => 'end');
// duration, 1 hour 2 min 3 sec, after end

example 2

$valarm->setProperty( 'trigger'
, FALSE, FALSE, FALSE, 1 );
// alt.
$valarm->setProperty( 'trigger'
, array ( 'week' => 1 ));
// alt.
$valarm->setProperty( 'trigger'
, '-P1W';
// duration, 1 week before start

example 3

$valarm->setProperty( 'trigger'
, array( 'year' => 2007, 'month' => 6, 'day' => 5, 'hour' => 2, 'min' => 2, 'sec' => 3, 'tz' => '-0200' ) );
// local date + UTC offset sets UTC format date

example 4

$valarm->setProperty( 'trigger'
, array( 'year' => 2007, 'month' => 6, 'day' => 5, 'hour' => 2, 'min' => 2, 'sec' => 3 ) );
// UTC date

[index]

3.2.40 TZID

This property specifies the text value that uniquely identifies the VTIMEZONE calendar component.
get TZID

format

getProperty( 'TZID' )

output = tzid 1

getProperty( 'TZID', FALSE , TRUE )

output = array( 'value' => tzid 1
, 'params' => xparam 2 )

example

$tzid = $vtimezone->getProperty( 'TZID' );

set TZID

format

setProperty( 'tzid', tzid [, xparam ] )

tzid 1=Value type TEXT
xparam 2=array( *[ xparamkey => xparamvalue ] )

example

$calendar = new vcalendar();
$timezone = new vtimezone();
$timezone->setProperty( 'tzid', 'US-Eastern' );
.. .

[index]

3.2.41 TZNAME

This property specifies the customary designation for a timezone description.
get TZNAME

format

getProperty( 'TZNAME' )

output = tzname 1

getProperty( 'TZNAME', int propOrderNo/FALSE, TRUE )

output = array( 'value' => tzname 1
, 'params' => params 2 )

example

$tzname = $timezonestandard->getProperty( 'TZNAME' );

Set TZNAME

format

setProperty( 'tzname', tzname [, params ] )

tzname 1=Value type TEXT
params 2=array( [ 'LANGUAGE' => '<lang>' ] [, xparam ] )
xparam=*[ xparamkey => xparamvalue ]

example

$calendar = new vcalendar();
$timezone = new vtimezone();
$timezone->setProperty( 'Tzid', 'US-Eastern' );
$timezone->setProperty( 'Last-Modified', '19870101' );
$timezonestandard = new vtimezone( 'standard' );
$timezonestandard->setProperty( 'tzname', 'EST' );
.. .

[index]

3.2.42 TZOFFSETFROM

This property specifies the offset which is in use prior to this timezone observance.
get TZOFFSETFROM

format

getProperty( 'TZOFFSETFROM' )

output = tzoffsetfrom 1

getProperty( 'TZOFFSETFROM', FALSE , TRUE )

output = array( 'value' => tzoffsetfrom 1
, 'params' => xparam 2 )

example

$tzoffsetfrom = $timezonestandard->getProperty( 'TZOFFSETFROM' );

Set TZOFFSETFROM

format

setProperty( 'tzoffsetfrom', tzoffsetfrom [, xparam ] )

tzoffsetfrom 1=(+/-)HHmm[ss], UTC offset
xparam 2=array( *[ xparamkey => xparamvalue ] )

example

$calendar = new vcalendar();
$timezone = new vtimezone();
$timezone->setProperty( 'Tzid', 'US-Eastern' );
$timezone->setProperty( 'Last-Modified', '19870101' );
$timezonestandard = new vtimezone( 'standard' );
$timezonestandard->setProperty( 'tzname', 'EST' );
$timezonestandard->setProperty( 'tzoffsetfrom', '-0500' );
.. .

[index]

3.2.43 TZOFFSETTO

This property specifies the offset which is in use in this timezone observance.
get TZOFFSETTO

format

getProperty( 'TZOFFSETTO' )

output = tzoffsetto 1

getProperty( 'TZOFFSETTO', FALSE , TRUE )

output = array( 'value' => tzoffsetto 1
, 'params' => xparam 2 )

example

$tzoffsetto = $timezonestandard->getProperty( 'TZOFFSETTO' );

Set TZOFFSETTO

format

setproperty( 'tzoffsetto', tzoffsetto [, xparam ] )

tzoffsetto 1=(+/-)HHmm[ss], UTC offset
xparam 2=array( *[ xparamkey => xparamvalue ] )

example

$calendar = new vcalendar();
$timezone = new vtimezone();
$timezone->setProperty( 'Tzid', 'US-Eastern' );
$timezone->setProperty( 'Last-Modified', '19870101' );
$timezonestandard = new vtimezone( 'standard' );
.. .
$timezonedaylight = new vtimezone( 'daylight' );
$timezonedaylight->setProperty( 'tzoffsetto', '1345' );
.. .

[index]

3.2.44 TZURL

The TZURL provides a means for a VTIMEZONE component to point to a network location that can be used to retrieve an up-to-date version of itself.
get TZURL

format

getProperty( 'TZURL' )

output = tzurl 1

getProperty( 'TZURL', FALSE , TRUE )

output = array( 'value' => tzurl 1
, 'params' => xparam 2 )

example

$tzurl = $timezonestandard->getProperty( 'TZURL' );

set TZURL

format

setProperty( 'tzurl', tzurl [, xparam ] )

tzurl 1=Value type URI
xparam 2=array( *[ xparamkey => xparamvalue ] )

example

$calendar = new vcalendar();
$timezone = new vtimezone();
$timezone->setProperty( 'Tzid', 'US-Eastern' );
$timezone->setProperty( 'Last-Modified', '19870101T000000' );
$timezone->setProperty( 'tzurl', 'http://zones.stds_r_us.net/tz/US-Eastern' );
.. .

[index]

3.2.45 UID

The persistent, globally unique identifier for the calendar component. Unique_id, set at calendar level(setConfig), is used when creating component uid.
get UID

format

getProperty( 'UID' )

output = uid 1

getProperty( 'UID', FALSE , TRUE )

output = array( 'value' => uid 1
, 'params' => xparam 2 )

example

$uid = $vevent->getProperty( 'UID' );

Set UID
AUTO GENERATED at component creation but NOT in ALARM/VTIMEZONE components.
UID generated format : date('Ymd\THisT').'-'.[random].'@'.unique_id
random = 10 characters aA-zZ, 0-9

format

setProperty( 'uid', uid [, xparam ] )

uid 1=Value type TEXT
xparam 2=array( *[ xparamkey => xparamvalue ] )

example

$vevent->setProperty('uid','20070803T194810CEST-Lm0kU3PXiX@domain.com');

[index]

3.2.46 URL

This property defines a Uniform Resource Locator (URL) associated with the iCalendar object.
get URL

format

getProperty( 'URL' )

output = url 1

getProperty( 'URL', FALSE , TRUE )

output = array( 'value' => url 1
, 'params' => xparam 2 )

example

$url = $vevent->getProperty( 'URL' );

Set URL

format

setProperty( 'url', url [, xparam ] )

url 1=Value type URI
xparam 2=array( *[ xparamkey => xparamvalue ] (

example

$vtodo->setProperty( 'url', 'http://www.icaldomain.net' );

[index]

3.2.47 X-PROPERTY

Any calendar component property name with a "X-" prefix and text value. If x-prop with the same name exists, it will be replaced.
Get X-property

format

getProperty()

output = array( propertyName 1 , propertyData 2 )

getProperty( FALSE, int propOrderNo/FALSE, TRUE )

output = array( propertyName 1
, array( 'value'=> propertyData 2 )
, 'params'=> params 3))

example 1

$v = new vcalendar();
$v->parse( 'file.ics' );
while( $xprop = $v->getProperty( )) {
.. .

$xprop = array( propertyName 1, propertyData 2 )

example 2

$v = new vcalendar();
$v->parse( 'file.ics' );
while( $xprop = $v->getProperty( 'X-ABC-MMSUBJ' )) {
.. .

$xprop = array( 'X-ABC-MMSUBJ', propertyData 2 )

example 3

$v = new vcalendar();
$v->parse( 'file.ics' );
while( $xprop = $v->getProperty( FALSE, FALSE, TRUE )) {
.. .

$xprop = array( propertyName 1
, array( 'value'=> propertyData 2 )
, 'params'=> params 3 )

Set X-property

format

setProperty( propertyName, propertyData [, params ] )

propertyName 1=Any property name with a "X-" prefix
propertyData 2=Value type TEXT
params 3=array( ['LANGUAGE' => '<lang>'] [, xparam] )
xparam=*[ xparamkey => xparamvalue ]

example

$component->setProperty('X-ABC-MMSUBJ','http://load.noise.org/mysubj.wav');

[index]

3.3 Calendar Component configuration functions

3.3.1 Language

Language for specific calendar component as defined in [RFC 1766]. Language set at component level can be overridden by specific component property parameter.
Get language
Language for calendar (only if language is set at component level).

format

getConfig( 'language' )

example

$lang = $vevent->getConfig( 'language' );

Set LANGUAGE

format

setConfig( 'language', string <lang> )

example

$vevent->setConfig( 'lang', 'en' );

[index]

3.4 Calendar component object misc. functions

Calendar component subcomponent functions

3.4.1 deleteComponent

Remove subcomponent from component.

format

deleteComponent( int orderNumber )

Remove component with order number (1st=1, 2nd=2.. .).

deleteComponent( string componentType [, int componentSuborderNumber])

Remove component with component type (ex. 'vevent') and order 1 alt. suborder number.

deleteComponent( string UID )

Remove component with UID. N.B UID is NOT set for alarm/timzone components.

example

$v = new vcalendar();
$v->parse( 'file.ics' );
$comp1 = $v->getComponent());
$comp1->deleteComponent( 1 );
.. .

[index]

3.4.2 getComponent

Get subComponent from component.

format

getComponent()

Get next component until end-of-components.

getComponent( int orderNumber )

Get component with order number (1st=1, 2nd=2.. .).

getComponent( string componentType [, int componentSuborderNumber])

Get (next) component with component type (until end-of-components) alt.
Get component with component type and suborder number (1st=1, 2nd=2.. .).

getComponent( string UID )

Get component with UID. N.B UID is NOT set for alarm/timzone components.

example

$v = new vcalendar();
$v->parse( 'file.ics' );
$comp1 = $v->getComponent());
while( $subComp = $comp1->getComponent()) {
.. .

[index]

3.4.3 setComponent

Add calendar component to calendar or replace/update component in calendar.

format

setComponent( component )
addSubComponent( component ) // alias

Insert last in component chain.

setComponent( component, int orderNumber )

Replace component with order number(1st=1, 2nd=2.. .). If orderNumber is not found, component is inserted last in chain.

setComponent( component, string componentType [, component suborder number])

Replace component with component type and component order number. if orderNumber is not found, component is inserted last in chain.

setComponent( component, string UID )

Replace component with UID. N.B UID is NOT set for alarm/timzone components.

example

$calendar = new vcalendar(); // initiate new CALENDAR
.. .
$vevent = new vevent(); // initiate EVENT
$vevent->setProperty( 'dtstart' // add some event properties
, 2006, 12, 24, 19, 30, 00 );
$vevent->setProperty(.. .
.. .
$valarm = new valarm(); // initiate ALARM
$valarm->setProperty( 'trigger', .. .
.. .
$vevent->setComponent ( $valarm ); // add alarm to event
.. .

[index]

4. COPYRIGHT AND LICENSE

Copyright

iCalcreator class
copyright (c) 2007 Kjell-Inge Gustafsson, kigkonsult
www.kigkonsult.se/iCalcreator/index.php
ical@kigkonsult.se

License

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or download it here.

[index]