iCalcreator v2.16.6
iCalcreator v2.16.6
copyright (c) 2007-2013 Kjell-Inge Gustafsson, kigkonsult
kigkonsult.se iCalcreator
kigkonsult.se contact
iCalcreator is a PHP implementation of RFC2445/RFC2446 to manage iCal/xCal formatted files.
iCalcreator is a PHP class package managing iCal files, supporting (non-)calendar systems and applications to process and communicate calendar information like events, agendas, tasks, reports, totos and journaling information.
iCalcreator features create, parse, edit and select calendar and calendar components.
The iCalcreator package, built of a calendar class with support of a function class and helper functions, are calendar component property oriented. For iCalcreator 2.16 version (and later), PHP version >= 5.2.0 is required, due to the use of PHP DateTime class (and related functions) .
The iCalcreator main class, utility class and helper functions are all included in the "iCalcreator.class.php" file.
More iCalcreator supplementary, "howto" and coding support information will be found at kigkonsult.se iCalcreator implement examples and test pages. A strong recommendation is to have this document open in parallell when exploiting the link.
iCalcreator will support hiphop if the HDF AllDynamic option is enabled (the helper iCal2XML and XMl2iCal functions are excluded).
. ..allows for the capture and exchange of information normally stored within a calendaring and scheduling application.
and. ..is an exchange format between applications or systems.
rfc5545 and rfc5546 obsoletes, respectively, rfc2445 and rfc2446.
A short iCal description is found at Wikipedia. If You are not familiar with iCal, read this first! Knowledge of calendar protocol rfc5545/rfc5546 is to recommend.
Any references to rfc2445, below, corresponds to rfc5545.
iCalcreator also supports xCal (iCal xml) rfc6321, "xCal: The XML Format for iCalendar", to be downloaded from
A short xCal description is found at Wikipedia.
This style is used for text.
This style is used for formats.
<?php .. . This style is used for PHP coding examples. // this style is used for coding comments. .. .
This style is used for content details.
This style is used for RFC2445/5545 quotes.
The release numbering convention used is major.minor(.micro / suffix).
The main support channel is using iCalcreator Sourceforge forum.
Use the contact page for queries, improvement/development issues or professional support and development. Please note that paid support or consulting service has the highest priority.
kigkonsult offer services for software support, design and development of customizations and adaptations of PHP/MySQL solutions with a special focus on software long term utility and reliability, supported through our agile acquire/design/transition process model.
You can show your appreciation for our free software, and can support future development by making a donation to the kigkonsult project iCalcreator.
Make a donation of any size by clicking here. Thanks in advance!
Unpack to any folder
- add this folder to your include-path
- or unpack to your application-(include)-folder
Add
require_once "[folder/]iCalcreator.class.php";
to your PHP-script.
If using PHP version 5.1 or higher, the default timezone may need to be set.
Creating a new iCalcreator object instance/component instance, review config settings.
To really boost performance, kigkonsult can now offer PHP (4 and 5) packages (iCalcreator etc) in byte coded files, using ionCube encoder.
Encoded files use a platform independent file format, and can be run on any platform for which ionCube supply a (free) Loader. Currently supported platforms are Windows (e.g. NT, XP, W2K), Intel Linux, FreeBSD, NetBSD, OpenBSD, OS X, and Sparc Solaris.
Visit kigkonsult.se contact page for information and purchase.
Use basic install (above), install ionCube Loader (requires an update of "php.ini" or additional file in "/etc/php.d" folder AND the execute rights to use the PHP "dl" function) and simply replace the PHP class files with the encoded files.
The following properties (as described in wikipedia:iCal) may be required when importing iCal files into some calendaring software (MS etc.):
Example
A strong recommendation is also to set config unique_id, creating a new vcalendar/component instance, to ensure accurate setting of all components UID property, especially before parse. Also setting of config timezone ("TZID" and "X-WR-TIMEZONE" below) is to recommend.
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); $vcalendar->setProperty( "method", "PUBLISH" ) $vcalendar->setProperty( "x-wr-calname", "Calendar Sample" ); $vcalendar->setProperty( "X-WR-CALDESC", "Calendar Description" ); $uuid = "3E26604A-50F4-4449-8B3E-E4F4932D05B5"; $vcalendar->setProperty( "X-WR-RELCALID", $uuid ); $vcalendar->setProperty( "X-WR-TIMEZONE", "Europe/Stockholm" ); .. .
For iCalcreator usage, coding samples and tests, visit the public kigkonsult.se test resource.
There are free iCal/xCal icons (use as buttons on a web page?) to download here.
The PHP coding in this document or "coding samples" (above) are only for display of usage, recommendation is to use a coding standard, the following, incomplete, list is a good start;
Quote from RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar)! (Described in iCal output format, content corresponds to xCal format.)
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
)
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] [top] [up]"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"
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] [top] [up]"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"
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] [top] [up]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] [top] [up]"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] [top] [up]"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
"duration" and "repeat" are both optional,and MUST NOT occur more than once each,
but if one occurs, so MUST the other
the following is optional, but MUST NOT occur more than once
attach /
the following is optional, and MAY occur more than once
)
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
the following is optional, and MAY occur more than once
)
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
the following are optional, and MAY occur more than once
)
procprop = 3*(
the following are all REQUIRED, but MUST NOT occur more than once
"duration" and "repeat" are both optional, and MUST NOT occur more than once each,
but if one occurs, so MUST the other
"description" is optional, and MUST NOT occur more than once
the following is optional, and MAY occur more than once
)
[index] [top] [up]"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
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
)
"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] [top] [up]A comprehensive table showing relation between calendar components and properties. vtimezone properties are not included.
0-1 | OPTIONAL property, MUST NOT occur more than once. | |||||||
0-m | OPTIONAL property, MAY occur more than once. | |||||||
0 / 1=1 | A pair of OPTIONAL properties, MUST NOT occur more than once each. If one occurs, so MUST the other |
|||||||
0*1 | A pair of OPTIONAL properties, MUST NOT occur more than once each. If one occurs, so MUST NOT the other |
|||||||
1-m | REQUIRED property, MAY occur more than once. | |||||||
1 | REQUIRED property, MUST NOT occur more than once. | |||||||
v e v e n t |
v t o d o |
v j o u r n a l |
v f r e e b u s y |
v a l a r m | ||||
a u d i o |
d i s p l a y |
e m a i l |
p r o c e d u r e |
|||||
action | 1 | 1 | 1 | 1 | ||||
attach | 0-m | 0-m | 0-m | 0-1 | 0-m | 1 | ||
attendee | 0-m | 0-m | 0-m | 0-m | 1-m | |||
categories | 0-m | 0-m | 0-m | |||||
class | 0-1 | 0-1 | 0-1 | |||||
comment | 0-m | 0-m | 0-m | 0-m | ||||
completed | 0-1 | |||||||
contact | 0-m | 0-m | 0-m | 0-1 | ||||
created | 0-1 | 0-1 | 0-1 | |||||
description | 0-1 | 0-1 | 0-m | 1 | 1 | 0-1 | ||
dtend | 0*1 | 0-1 | ||||||
dtstamp | 0-1 | 0-1 | 0-1 | 0-1 | ||||
dtstart | 0-1 | 0-1 | 0-1 | 0-1 | ||||
due | 0*1 | |||||||
duration | 0*1 | 0*1 | 0-1 | 0 / 1=1 | 0 / 1=1 | 0 / 1=1 | 0 / 1=1 | |
exdate | 0-m | 0-m | 0-m | |||||
exrule | 0-m | 0-m | 0-m | |||||
freebusy | 0-m | |||||||
geo | 0-1 | 0-1 | ||||||
last-mod | 0-1 | 0-1 | 0-1 | |||||
location | 0-1 | 0-1 | ||||||
organizer | 0-1 | 0-1 | 0-1 | 0-1 | ||||
percent | 0-1 | |||||||
priority | 0-1 | 0-1 | ||||||
rdate | 0-m | 0-m | 0-m | |||||
recurid | 0-1 | 0-1 | 0-1 | |||||
related | 0-m | 0-m | 0-m | |||||
repeat | 0 / 1=1 | 0 / 1=1 | 0 / 1=1 | 0 / 1=1 | ||||
resources | 0-m | 0-m | ||||||
rrule | 0-m | 0-m | 0-m | |||||
rstatus | 0-m | 0-m | 0-m | 0-m | ||||
sequence | 0-1 | 0-1 | 0-1 | |||||
status | 0-1 | 0-1 | 0-1 | |||||
summary | 0-1 | 0-1 | 0-1 | 1 | ||||
transp | 0-1 | |||||||
trigger | 1 | 1 | 1 | 1 | ||||
uid | 0-1 | 0-1 | 0-1 | 0-1 | ||||
url | 0-1 | 0-1 | 0-1 | 0-1 | ||||
x-prop | 0-m | 0-m | 0-m | 0-m | 0-m | 0-m | 0-m | 0-m |
If not set, the DTSTAMP and UID properties
are automatically created by iCalcreator
for vevent,vtodo, vjournal and vfreebusy components
when using iCalcreator object methods saveCalendar or returnCalendar
or when fetching DTSTAMP/UID property value with the component function getProperty.
Create a new VCALENDAR object.
Format
vcalendar::vcalendar( [ config ] )
config = array, review configuration options.
Basic example
<?php .. . $config = array( "unique_id" => "kigkonsult.se" ); $vcalendar = new vcalendar( $config ); ...
The calendar property PRODID and each component property UID are AUTOMATICALLY generated in iCalcreator, if not set manually, and based on the configuration unique_id.
Extended example
<?php .. . $tz = "Europe/Stockholm" $config = array( "unique_id" => "kigkonsult.se" "TZID" => $tz ); $vcalendar = new vcalendar( $config ); $vcalendar->setProperty( "X-WR-TIMEZONE", $tz ); .. . .. . // insert components or parse an iCal file (and edit components) .. . $xprops = array( "X-LIC-LOCATION" => $tz ); iCalUtilityFunctions::createTimezone( $vcalendar, $tz, $xprops ); .. .
The TZID config key and value (timezone) is supplied when setting DTSTART, DTEND, DUE or RECURRENCE-ID, if not set manually, a TZID auto completion.
Some calendar software may also require calendar property X-WR-TIMEZONE and vtimezone component with property X-LIC-LOCATION, review createTimezone, a function in iCalUtilityFunctions class.
Format 1
Create a new VEVENT object using an iCalcreator object component factory-method, returning a reference to the new component.
vcalendar::newComponent( "vevent" )
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vevent = & $vcalendar->newComponent( "vevent" ); $vevent->setProperty(... ...
Format 2
Create a new VEVENT object.
vevent::vevent( [ config ] )
config = array, review configuration options.
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $config = $vcalendar->getConfig(); $vevent = new vevent( $config ); $vevent->setProperty(... ... $vcalendar->setComponent( $vevent ); ...
Format 1
Create a new VTODO object using an iCalcreator object component factory-method, returning a reference to the new component.
vcalendar::newComponent( "vtodo" )
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vtodo = & $vcalendar->newComponent( "vtodo" ); $vtodo->setProperty(... ...
Format 2
Create a new VTODO object.
vtodo::vtodo( [ config ] )
config = array, review configuration options.
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vtodo = new vtodo( $vcalendar->getConfig()); $vtodo->setProperty(... ... $vcalendar->setComponent( $vtodo ); ...
Format 1
Create a new VJOURNAL object using an iCalcreator object factory-method, returning a reference to the new component.
vcalendar::newComponent( "vjournal" )
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vjournal = & $vcalendar->newComponent( "vjournal" ); $vjournal->setProperty(... ...
Format 2
Create a new VJOURNAL object.
vjournal::vjournal( [ config ] )
config = array, review configuration options.
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vjournal = new vjournal( $vcalendar->getConfig()); $vjournal->setProperty(... ... $vcalendar->setComponent( $vjournal ); ...
Format 1
Create a new VFREEBUSY object using an iCalcreator object factory-method, returning a reference to the new component.
vcalendar::newComponent( "vfreebusy" )
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vfreebusy = & $vcalendar->newComponent( "vfreebusy" ); $vfreebusy->setProperty(... ...
Format 2
Create a new VFREEBUSY object.
vfreebusy::vfreebusy( [ config ] )
config = array, review configuration options.
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vfreebusy = new vfreebusy( $vcalendar->getConfig()); $vfreebusy->setProperty(... ... $vcalendar->setComponent( $vfreebusy ); ...
Format 1
Create a new VALARM object using an iCalcreator object component factory-method, returning a reference to the new (sub-)component.
calendarComponent::newComponent( "valarm" )
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vevent = & $vcalendar->newComponent( "vevent" ); $vevent->setProperty(... ... $valarm = & $vevent->newComponent( "valarm" ); $valarm->setProperty(... ...
Format 2
Create a new VALARM object.
valarm::valarm( [ config ] )
config = array, review configuration options.
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vevent = new vevent(); $vevent->setProperty(... ... $valarm = new valarm( $vevent->getConfig()); $valarm->setProperty(... ... $vevent->setComponent( $valarm ); ... $vcalendar->setComponent( $vevent ); ...
The vtimezone component describe, at a minimum, the base offset from UTC for the time zone. For dates with UTC DATE-TIME, read this!
Format 1
Create a new VTIMEZONE object using an iCalcreator object component factory-method, returning a reference to the new component.
vcalendar::newComponent( "vtimezone" )
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vtimezone = & $vcalendar->newComponent( "vtimezone" ); $vtimezone->setProperty(... ...
Format 2
Create a new VTIMEZONE object.
vtimezone::vtimezone( [ config ] )
config = array, review configuration options.
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vtimezone = new vtimezone( $vcalendar->getConfig()); $vtimezone->setProperty(... ... $vcalendar->setComponent( $vtimezone ); ...
It is possible to create timezone components, using a function in iCalUtilityFunctions class, createTimezone and utilizing the PHP DateTimeZone class (PHP 5 >= 5.2.0).
Format 1
Create a new VTIMEZONE standard object using an iCalcreator object component factory-method, returning a reference to the new (sub-)component.
vtimezone::newComponent( "standard" )
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vtimezone = & $vcalendar->newComponent( "vtimezone" ); $vtimezone->setProperty(... ... $standard = & $vtimezone->newComponent( "standard" ); $standard->setProperty(... ... $daylight = & $vtimezone->newComponent( "daylight" ); $daylight->setProperty(... ...
Format 2
Create a new VTIMEZONE STANDARD object.
vtimezone::vtimezone( "standard" [, config ] )
config = array, review configuration options.
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vtimezone = new vtimezone( $vcalendar->getConfig()); $vtimezone->setProperty(... ... $standard = new vtimezone( "standard", $vtimezone->getConfig()); $standard->setProperty(... ... $vtimezone->setComponent( $standard ); ... $daylight = new vtimezone( "daylight", $vtimezone->getConfig()); $daylight->setProperty(... ... $vtimezone->setComponent( $daylight ); ... $vcalendar->setComponent( $vtimezone ); ...
Format 1
Create a new VTIMEZONE daylight object using a component factory-method, returning a reference to the new (sub-)component.
vtimezone::newComponent( "standard" )
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vtimezone = & $vcalendar->newComponent( "vtimezone" ); ... $standard = & $vtimezone->newComponent( "standard" ); ... $daylight = & $vtimezone->newComponent( "daylight" ); ...
Format 2
Create a new VTIMEZONE DAYLIGHT object.
vtimezone::vtimezone( "daylight" [, config ] )
config = array, review configuration options.
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vtimezone = new vtimezone( $vcalendar->getConfig()); ... $standard = new vtimezone( "standard", $vtimezone->getConfig()); ... $vtimezone->setComponent( $standard ); $daylight = new vtimezone( "daylight", $vtimezone->getConfig() ); ... $vtimezone->setComponent( $daylight ); $vcalendar->setComponent( $vtimezone ); ...
Generic iCalcreator object deleteProperty method, simplifying removal of calendar properties.
FALSE is returned if no property exists or when end-of-properties at consecutive function calls.
Format
vcalendar::deleteProperty( [ PropName [, order=1 ] )
propName = (string) case independent, [RFC5545] component property names, unknown/missing propName will be regarded as X-property. order = (int) if missing 1st/next occurrence, used with multiple (property) occurrences
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); if( !$vcalendar->deleteProperty( "method" )) echo "METHOD property not found"; .. .
Format 1
Generic iCalcreator getProperty method, simplifying fetch of calendar properties.
FALSE is returned if no property exists or when end-of-properties at consecutive function calls.
vcalendar::getProperty( [ PropName [, order=1 [, complete=FALSE ]]] )
propName = (string) case independent, [RFC5545] component property names, unknown/missing propName will be regarded as X-property. order = (int) if missing 1st/next occurrence, used with multiply (property) occurrences complete = (bool) FALSE (default) : output only property value TRUE : output = array( "value"=> <value> ,"params" => <parameter array>)
Example 1
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $calscale = $vcalendar->getProperty( "calscale" ); .. .
Example 2
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); while( $xprop = $vcalendar->getProperty( )) { // get x-properties .. .
Format 2
Ability to fetch specific component property (unique) value(-s) and number of occurrence(-s). The search includes ALL components within the iCalcreator object instance.
Outputs an array( *[ (string) unique-property-value => (int) number_of_occurrence ] ) or an empty array if no hits. The array is sorted by (asc.) key. If a property contains multiple values (like "CATAGORIES:course1,courseB" or "RESOURCES:pc,camera"), they are split into unique values.
To select components based on property values, use selectComponents (Format 2).
To get components based on property values, use getComponent (Format 5).
vcalendar::getProperty( PropName )
propName = (string) case independent, property name
Example 1
Fetch all attendees in the iCalcreator object instance.
<?php .. . $attendees = $vcalendar->getProperty( "ATTENDEE" ); foreach( $attendees as $attendee => $occurrCount ) { .. .
Example 2
Fetch all DTSTARTs in the iCalcreator object instance.
<?php .. . $startDates = $vcalendar->getProperty( "DTSTART" ); foreach( $startDates as $startDate => $occurrCount ) { .. .
Generic the iCalcreator object setProperty method,simplifying insert of calendar properties.
A successful update returns TRUE.
Format
vcalendar::setProperty( PropName, Proparg_1 *[, Proparg_n] )
propName = (string) case independent, strict [RFC5545] calendar property names, unknown propName will be regarded as (a non-standard) X-property. Proparg = (mixed) property argument Last property argument is a (optional) property dependent parameters array( *[(string) key => (string) value ] ). A non-standard (, experimental) parameter key MUST be prefixed by "X-".
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); // initiate new CALENDAR $vcalendar->setProperty( "calscale", "GREGORIAN" ); ...
This property defines the calendar scale used for the calendar information specified in the iCalendar object.
The default value is "GREGORIAN", implied when missing.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
vcalendar::createCalscale()
Example
<?php .. . $str = $vcalendar->createCalscale(); ...
Remove CALSCALE from calendar.
Format
vcalendar::deleteProperty( "calscale" )
Example
<?php .. . $vcalendar->deleteProperty( "CALSCALE" ); ...
If set, returns property value, otherwise FALSE.
Format
vcalendar::getProperty( "calscale" )
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $calscale = $vcalendar->getProperty( "calscale" ); .. .
Insert property value.
Format
vcalendar::setProperty( "calscale", value )
value = (string) calscale value
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); // initiate new CALENDAR $vcalendar->setProperty( "calscale", "GREGORIAN" ); .. .
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 some calendaring software (MS etc.), as well as x-properties "X-WR-CALNAME", "X-WR-CALDESC" and "X-WR-TIMEZONE" and the (automatically created) DTSTAMP and UID properties.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
vcalendar::createMethod()
Example
<?php .. . $str = $vcalendar->createMethod(); ...
Remove METHOD from calendar.
Format
vcalendar::deleteProperty( "METHOD" )
Example
<?php .. . $vcalendar->deleteProperty( "METHOD" ); ...
If set, returns property value, otherwise FALSE.
Format
vcalendar::getProperty( "method" );
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $method = $vcalendar->getProperty( "method" ); .. .
Insert property value.
Format
vcalendar::setProperty( "method", value )
value = (string) method value
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); // initiate new CALENDAR $vcalendar->setProperty( "method", "PUBLISH" ); ...
This property specifies the identifier corresponding to the version number of the iCalendar specification. This property is always placed first in the calendar file.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
vcalendar::createVersion()
Example
<?php .. . $str = $vcalendar->createVersion(); ...
Fetch property value.
Format
vcalendar::getProperty( "version" )
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $version = $vcalendar->getProperty( "version" ) .. .
Insert property value. Only version 2.0 valid, version is AUTO generated at calendar creation.
Format
vcalendar::setProperty( "version", version )
version = (string) iCal version
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); // initiate new CALENDAR $vcalendar->setProperty( "version", "2.0" ); ...
A calendar, non-standard property with a TEXT value and a name with an "X-" prefix. In a calendar, an x-property, with an unique name, can occur only once but the number of x-properties are unlimited.
X-properties "X-WR-CALNAME", "X-WR-CALDESC" and "X-WR-TIMEZONE" may be required when importing iCal files into some calendaring software (MS etc.), as well as METHOD property (value PUBLISH etc.) and the (automatically created) DTSTAMP and UID properties.
The value type is TEXT.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
vcalendar::createXprop()
Example
<?php .. . $str = $vcalendar->createXprop(); ...
Remove X-PROPERTY from calendar.
Format
vcalendar::deleteProperty( "<X-PROPERTY>" )
Example 1
Delete the x-property named "X-PROPERTY".
<?php .. . $vcalendar->deleteProperty( "X-PROPERTY" ); ...
Example 2
Delete all x-properties.
<?php .. . while( $vcalendar->deleteProperty()) continue; ...
If set, returns property (name and) value, otherwise FALSE.
Format
vcalendar::getProperty()
vcalendar::getProperty( "<X-PROPERTY>" )
output = array( propertyName1, propertyData2 )
vcalendar::getProperty( FALSE, propOrderNo/FALSE, TRUE )
propOrderNo = (int) specific property value
output = array( propertyName1 , array( "value" => propertyData2 ) , "params" => params3))
Example 1
Read all x-prop values in a loop.
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); while( $xprop = $vcalendar->getProperty( )) { // $xprop = array( propertyName1, propertyData2 ) .. .
Example 2
If exists, read X-WR-TIMEZONE x-prop
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); if( $xprop = $vcalendar->getProperty( "X-WR-TIMEZONE" )) { .. . // $xprop = array( "X-WR-TIMEZONE", propertyData2 ) .. .
Example 3
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); while( $xprop = $vcalendar->getProperty( FALSE, FALSE, TRUE )) { /* $xprop = array( propertyName1 , array( "value " => propertyData2 , "params "=> params3 )) */ .. .
Format
vcalendar::setProperty( propertyName, propertyData [, params ] )
propertyName1 = (string) Any property name with a "X-" prefix propertyData2 = (string) Value type TEXT params3 = (array) ( ["LANGUAGE" => (string) "lang*"] *[, xparams] ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5646]
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); // initiate new CALENDAR // set some X-properties.. . $vcalendar->setProperty( "x-wr-calname", "Calendar Sample" ) $vcalendar->setProperty( "X-WR-CALDESC", "Calendar Description" ); $vcalendar->setProperty( "X-WR-TIMEZONE", "Europe/Stockholm" ); ...
Remove component from the iCalcreator object instance.
FALSE is returned if no property exists or when end-of-properties at consecutive function calls.
format 1
Remove component with order number (1st=1, 2nd=2.. .).vcalendar::deleteComponent( orderNumber )
orderNumber = (int) order number
format 2
Remove component with component type (e.g. "vevent") and order 1 alt. suborder number.
vcalendar::deleteComponent( componentType [, componentSuborderNumber])
componentType = (string) component type componentSuborderNumber = (int) order number
format 3
Remove component with UID. N.B UID is NOT set for ALARM / TIMEZONE components.
vcalendar::deleteComponent( UID )
Example 1
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $vcalendar->deleteComponent( 1 ); $vcalendar->deleteComponent( "vtodo", 2 ); $vcalendar->deleteComponent( "20070803T194810CEST-0123U3PXiX@kigkonsult.se"); .. .
Example 2
Deleting all components, using format 2 without order number.
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); .. . while( $vcalendar->deleteComponent( "vevent")) continue; .. . $vtodo = $vcalendar->getComponent( "vtodo" ); while( $vtodo->deleteComponent( "valarm")) continue; .. .
Get component from the iCalcreator object instance.
FALSE is returned if no property exists or when end-of-properties at consecutive function calls.
format 1
Get next component, until end-of-components.
vcalendar::getComponent()
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); while( $comp = $vcalendar->getComponent()) { .. . } .. .
format 2
Get specific component with order number (1st=1, 2nd=2.. .).
vcalendar::getComponent( orderNumber )
orderNumber = (int) order number
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); if( $comp = $vcalendar->getComponent( 1 )) { .. . } .. .
format 3
Get (first/next) component with component type (until end-of-components) alt. get specific component with component type and suborder number (1st=1, 2nd=2.. .).
vcalendar::getComponent( componentType [, componentSuborderNumber])
componentType = (string) component type componentSuborderNumber = (int) order number
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); if( $comp = $vcalendar->getComponent( "vtodo", 2 )) { .. . } .. .
format 4
Get (first/next) component with UID as key. (UID is NOT set for ALARM / TIMEZONE components.)
vcalendar::getComponent( UID )
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $uid = "20070803T194810CEST-0123U3PXiX@kigkonsult.se"; if( $comp = $vcalendar->getComponent( $uid )) { .. . } .. .
format 5
Get (first/next) component based on specific property contents:
For the property "SUMMARY" ,if a search value (any case) exists within property value, a hit exists. For the other, non-date, properties an exact (strict case) match is required.
To select components based on property values, use selectComponents (Format 2).
To retrieve specific iCalcreator instance property values, searching ALL components, use getProperty (Format 2).
vcalendar::getComponent( search )
search = (array) ( *[ propertyName => uniqueValue ]), multiple array elements are combined by "OR" propertyName = (string) property name, above propertyData = (string) unique property value (strict case), date format "YYYYMMDD" (if any side is DATE, only dates are used), datetime format "YYYYMMDDTHHMMSS"
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); while( $comp = $vcalendar->getComponent( array( "RESOURCES" => "PC" )) { .. . } .. .
Create component (VEVENT / VTODO / VJOURNAL / VFREEBUSY / VTIMEZONE) using a iCalcreator object factory-method, returning a reference to the new component.
Format
vcalendar::newComponent( componentType )
componentType = (string) component type
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vevent = & $vcalendar->newComponent( "vevent" ); ...
Format 1
Selects EVENT / VTODO / VJOURNAL / VFREEBUSY components from the iCalcreator object instance on based on dates (notice date restriction), based on the initial DTSTART property along with the RRULE, RDATE, EXDATE and EXRULE properties in the component.
Requirement:
Limitations:
FALSE is returned if no selected component exists.
vcalendar::selectComponents([ startYear, startMonth, startDay [, endYear, endMonth, endDay [, cType [, flat [, any [, split]]]]]])
Returns an array with components (events.. .).
For all recurrent instances of a calendar component, an x-property,
"X-CURRENT-DTSTART" and opt. also "X-CURRENT-DTEND" alt. "X-CURRENT-DUE",
has been created with a TEXT content, "Y-m-d [H:i:s][timezone/UTC offset]"
showing the current start and opt. also end alt. due date.
Also a "X-RECURRENCE" x-property is set with order number (valid if selectComponents is called from DTSTART date).
startYear : (int) start year (4*digit), default current year startMonth : (int) start month (1-2*digit), default current month startDay : (int) start day (1-2*digit), default current day endYear : (int) end year (4*digit), default startYear endMonth : (int) end month (1-2*digit), default startMonth endDay : (int) end day (1-2*digit), default startDay cType : (mixed) calendar component type(-s), (string/array) ("vevent", "vtodo", "vjournal", "vfreebusy") (bool) FALSE (default) => all flat : (bool) TRUE => output : array[] (ignores split) component where recurrence pattern exists within period FALSE (default) => output : array[Year][Month][Day][] any : (bool) TRUE (default) => select components with recurrence within period FALSE => only components that starts (DTSTART) within period split : (bool) TRUE (default) => one component copy for every day it occurs within the period FALSE => one occurrence of component in output array, start date/recurrence (start) date valid flat any split combinations (defaults in upper case) 1 FALSE TRUE TRUE 2 FALSE TRUE false 3 FALSE false [false] (split set to false if flat=FALSE and any=false) 4 true TRUE [false] (split set to false if flat=true) 5 true false [false] (split set to false if flat=true)
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "directory" => "import", "filename" => "file.ics" ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $events_arr = $vcalendar->selectComponents( 2007, 11, 1, 2007, 11, 30, "vevent" ); // select all events occurring 1-30 nov. 2007 foreach( $events_arr as $year => $year_arr ) { foreach( $year_arr as $month => $month_arr ) { foreach( $month_arr as $day => $day_arr ) { foreach( $day_arr as $event ) { $currddate = $event->getProperty( "x-current-dtstart" ); // if member of a recurrence set, returns // array(" x-current-dtstart", // <(string) date("Y-m-d [H:i:s][timezone/UTC offset]")>) $startDate = $event->getProperty( "dtstart" ); $summary = $event->getProperty( "summary" ); $description = $event->getProperty( "description" ); .. . .. .
format 2
Using this format, the iCalcreator object method selects components based on specific property value(-s).
For the property SUMMARY, if a search value (any case) exists within property value, a hit is found. For the other properties an exact (strict case) match is required. Multiple search properties may coexist.
To retrieve specific iCalcreator instance property values, searching ALL components, use getProperty (Format 2).
To get components based on property values, use getComponent (Format 5).
vcalendar::selectComponents( searchArray )
Outputs an array of matched (unique) components in UID order.
searchArray : (array) *( propertyName => propertyValue ) propertyName : (string) above (any case) propertyValue : (string) value / (array) ( *[ (string) value] )
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "directory" => "import", "filename" => "file.ics" ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $searchArray = array( "PRIORITY" => array( 1, 2, 3, 4 )); $highPrioArr = $vcalendar->selectComponents( $searchArray ); // select all components with PRIORITY set to high (1-4) if( !empty( $highPrioArr )) { $highPrioCal = new vcalendar( array( "unique_id" => "kigkonsult.se" )); $highPrioCal->setProperty( "X-WR-CALDESC", "High priority events" ); foreach( $highPrioArr as $highPrioComponent ) $highPrioCal->setComponent( $highPrioComponent ); $highPrioCal->returnCalendar(); } .. .
Replace or update component in the iCalcreator object instance. Also add a calendar component to the iCalcreator object instance when calendar component is created with the procedural (non-factory) method, see example VEVENT, format 2.
A successful update returns TRUE.
format 1
Insert last in component chain.
vcalendar::setComponent( component ) addComponent( component ) // alias
component = (object) iCalcreator component instance
addComponent, may be removed in future versions.
format 2
Insert/replace component with order number (1st=1, 2nd=2.. .). If replace and orderNumber is not found, component is inserted last in chain.
vcalendar::setComponent( component, orderNumber )
component = (object) iCalcreator component instance int = (int) order numder
format 3
Replace component with component type and 1st alt. component order number. If orderNumber is not found, component is inserted last in chain.
vcalendar::setComponent( component, componentType [, componentSuborderNo])
component = (object) iCalcreator component instance componentType = (string) component type componentSuborderNo = (int) component Suborder Number
format 4
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.
vcalendar::setComponent( component, UID )
component = (object) iCalcreator component instance
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics"); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $vevent = vcalendar->getComponent( 1 ); // fetch first EVENT $vevent->setProperty( "dtstart, 2006, 12, 24, 19, 30, 00 ); // update DTSTART property $vcalendar->setComponent( $vevent, 1 ); // replace first component .. .
Parse iCal file(-s) or string/array calendar content into a single iCalcreator object instance (components, properties and parameters), including multiple vcalendars (within a single ICS file) parse, e.g. Oracle Calendar exports.
As long as php.ini directive "allow_url_fopen" is enabled, remote files, URLs; protocol "http" ("webcal"), are supported. A remote file, URL, must be prefixed by "http://" ("webcal://") and suffixed by a valid filename.! Recommendation is to download (cache) remote file before parsing, due to execution time and control.
If missing, component property UID is created when parsing. For that reason UNIQUE_ID might need to be set before parsing, Se examples below.
Notice date restriction!
If major parse error occurs (like file access error, invalid calendar file or calendar file without components), FALSE is returned.
Minor errors like non-standard line-endings, initial and trailing empty lines as well as files without proper end line(-s) (i.e. missing component end and/or "END:CALENDAR" iCal directives) are managed.
Non-standard iCal properties (except the X-properties) are ignored.
Format
vcalendar::parse( [ textToParse ] )
textToParse = (string) calendarContent ex. result from - file_get_contents( "filename") (array) calendarContent ex. result from - file( "filename", FILE_IGNORE_NEW_LINES )
parse example 1
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics" ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); .. .
parse example 2
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "url" => "http://www.ical.net/calendars/calendar.ics" ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); .. .
parse example 3
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "url" => "http://www.ical.net/calendars/calendar.ics" ); $vcalendar = new vcalendar( $config ); ... $str = array( "BEGIN:VCALENDAR", "PRODID:-//kigkonsult.se//NONSGML kigkonsult.se iCalcreator 2.16.6//", "VERSION:2.0", "BEGIN:VEVENT", "DTSTART:20101224T190000Z", "DTEND:20101224T200000Z", "DTSTAMP:20101020T103827Z", "UID:20101020T113827-1234GkdhFR@test.org", "DESCRIPTION:example", "END:VEVENT", "END:VCALENDAR"); $vcalendar->parse( $str ); ...
merge example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "directory" => "import" ); $vcalendar = new vcalendar( $config ); $vcalendar->setConfig( "filename", "file1.ics" ); $vcalendar->parse(); $vcalendar->setConfig( "filename", "file2.ics" ); $vcalendar->parse(); $vcalendar->setConfig( "directory", "export" ); $vcalendar->setConfig( "filename", "icalmerge.ics" ); $vcalendar->saveCalendar(); .. .
Format
vcalendar::createCalendar()
Example
<?php .. . $str = $vcalendar->createCalendar(); echo $str; ...
Redirect the iCalcreator object instance content to user browser. Filename, addressed to browser, is automatically generated if missing or not set;
$filename = date( "YmdHis" ).".ics" .
Format
vcalendar::returnCalendar( [ utf8Encode [, gzip ]] )
utf8Encode = (bool) TRUE: utf8 encoded output, FALSE: (default) no encoding gzip = (bool) TRUE: gzip compressed output Header "Content-Length" only sent when gzip=TRUE FALSE: (default) no compressing
Example 1
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); .. . $vevent = & $vcalendar->newComponent( "vevent" ); $vevent->setProperty( "dtstart", array( "year" => 2007 , "month" => 4 , "day" => 1 , "hour" => 19 )); $vevent->setProperty( "duration", 0, 0, 3 )); $vevent->setProperty( "LOCATION", "Central Plaza" ); $vevent->setProperty( "summary", "PHP summit" ); .. . $vcalendar->returnCalendar(); .. .
Example 2
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "directory" => "import", "filename" => "file.ics" ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $utf8Encode = TRUE; if( isset( $_SERVER["HTTP_ACCEPT_ENCODING"] ) && ( FALSE !== strpos( strtolower( $_SERVER["HTTP_ACCEPT_ENCODING"] ), "gzip" ))) $gzip = TRUE; else $gzip = FALSE; $vcalendar->returnCalendar( $utf8Encode, $gzip ); ...
Save the iCalcreator object instance in a file, uses present directory if directory not set, filename is automatically generated if missing or not set;
$filename = date( "YmdHis" ).".ics" .
Directory/filename must be writeable, delimiter default PHP constant DIRECTORY_SEPARATOR.
If file error occurs, FALSE is returned.
Format
vcalendar::saveCalendar ( [ directory [, filename [, delimiter ]]] )
directory = (string) directory, default FALSE filename = (string file name, default FALSE delimiter = (string) path directory/filename separator, default FALSE
Parameters for directory/filename/delimiter, kept for backward compatibility, may be removed i future versions. Recommendation is to use setConfig, Se example below.Example
<?php .. . $vcalendar->setConfig( array( "directory" => "depot", "filename" => "calendar.ics" )); $result = $vcalendar->saveCalendar(); if( !$result ) echo "error when saving.. ." ...
Format 1
Sort created/parsed calendar components on the following (prioritized) keys:
1 - X-CURRENT-DTSTART - X-CURRENT-DTEND/X-CURRENT-DUE
(if created in iCalcreator object method selectComponents)
1 - DTSTART - DTEND alt. DURATION (VEVENT and VFREEBUSY components)
1 - DTSTART - DUE alt. DURATION (VTODO components)
1 - DTSTART (VJOURNAL components)
2 - CREATED / DTSTAMP
3 - UID
A date value, like "DTSTART;VALUE=DATE:20120717", are sorted before a datetime value.
VTIMEZONE component(-s) is always placed first (ordered by TZID). The
STANDARD / DAYLIGHT sub-components are sorted (on asc. key DTSTART) when calling
createCalendar (or returnCalender).
ALARM sub-components, if exists, are not sorted.
vcalendar::sort()
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "directory" => "import", "filename" => "file.ics" ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $vcalendar->returnCalendar(); ...
Format 2
Sort created/parsed calendar components based on specific property values and ascending order. If a property is not set in component, an empty sort key is used (i.e. sorted first).
vcalendar::sort( sortArgument )
sortArgument: (string) "ATTENDEE" * / "CATEGORIES" * / "CONTACT" * / "DTSTAMP" / "LOCATION"" / "ORGANIZER" / "PRIORITY" / "RESOURCES" * / "STATUS" / "SUMMARY" / "URL" / "UID" **.
*) For a property where multiple occurrence may exist (ATTENDEE, CATEGORIES, CONTACT, RESOURCES) lowest (alphabetic) value is used as sort key.
**) For multiple components with the same UID, components with RECURRENCE-ID / SEQUENCE set are sorted first (on asc. values).
If recent version of local (non-empty and saved) calendar file exists, an HTTP redirect header is sent otherwise FALSE is returned.
Format
vcalendar::useCachedCalendar( [ timeout ] )
vcalendar::useCachedCalendar( [ directory [, filename [, delimiter [, timeout ]]]] )
directory = (string) directory, default FALSE
filename = (string file name, default FALSE
delimiter = (string) path directory/filename separator, default FALSE
timeout = (int) default 3600 sec
Second format with parameters for directory/filename/delimiter,
kept for backward compatibility, may be removed i future
versions. Recommendation is to use setConfig, Se example below.
Example
<?php .. . $vcalendar->setConfig( "directory", "depot" ); $vcalendar->setConfig( "filename", "calendar.ics" ); $vcalendar->useCachedCalendar(); ...
All configuration keys (allowEmpty, compsInfo etc.) case independent.
key | calendar | component | remark |
allowEmpty | * | * | |
Compsinfo | * | * | getConfig only |
Delimiter | * | ||
Directory | * | ||
Filename | * | ||
Dirfile | * | getConfig only | |
Filesize | * | getConfig only | |
Format | * | ||
Language | * | * | |
NewlineChar | * | * | |
setPropertyNames | * | getConfig only | |
TZID | * | * | |
Unique_id | * | * | |
URL | * |
vcalendar::getConfig( [ key ] )
key = (string) config key
Example 1
<?php .. . $filename = $vcalendar->getConfig( "filename" ); .. .
In this example, notice FilenameExample 2
<?php .. . $config = $vcalendar->getConfig(); .. .
Output= array( string key => mixed value *[, string key => mixed value] )
Format
Create a new iCalcreator object instance.
vcalendar::vcalendar( [ config ] )
config = (array) ( *[, key => value] ) key = (string) config key value = (mixed) config value
Example 1
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "directory" => "import", "filename" => "file.ics" ); $vcalendar = new vcalendar( $config ); .. .
Create a new calendar component.
vcalendar::component( [ config ] )
config = (array) ( key => value *[, key => value] ) key = (string) config key value = (mixed) config value
Example 2
<?php .. . $config = array( "unique_id" => "kigkonsult.se" ); $vevent = new vevent( $config ); .. .
Example 3
<?php .. . $config = $vcalendar->getConfig(); $vevent = new vevent( $config ); .. .
Only component relevant configuration are set. If using the newComponent function, configuration is set automatically.
A successful "setConfig" returns TRUE.
Format 1
vcalendar::setConfig( [ config ] )
config = (array) ( key => value *[, key => value] ) key = (string) config key value = (mixed) config value
Example 1
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "directory" => "import", "filename" => "file.ics" ); $vcalendar = new vcalendar(); $vcalendar->setConfig( $config ); .. .
Example 2
<?php .. . $config = array( "unique_id" => "kigkonsult.se" ); $vevent = new vevent(); $vevent->setConfig( $config ); .. .
Format 2
vcalendar::setConfig( key, value )
key = (string) config key value = (mixed) config value
Example 1
<?php .. . $vcalendar = new vcalendar(); $vcalendar->setConfig( "directory", "depot" ); .. .
Example 2
<?php .. . $vevent = new vevent(); $vevent->setConfig( "unique_id", "kigkonsult.se" ); .. .
Allow or reject empty calendar properties. Used in createCalendar, returnCalender or create<Property> methods, creating [RFC5545] formats.
Default TRUE (allow).
Only to use with iCalcreator object method getConfig.
Get information about the iCalcreator object instance components. Returns array with basic information about all components (in array format) within the iCalcreator object instance.
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 for each subcomponent
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "directory" => "import", "filename" => "file.ics" ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $compsinfo = $vcalendar->getConfig( "compsinfo" ); foreach( $compsinfo as compinfo) { echo " order number : ".$compinfo["ordno"]."<br />"; echo " type : ".$compinfo["type"]."<br />"; echo " UID : ".$compinfo["uid"]."<br />"; foreach( $compinfo["props"] as $propertyName => $propertyCount ) echo " $propertyName = $propertyCount"; if( is_array( $compinfo["sub"] )) { foreach( $compinfo["sub"] as $subcompinfo ) { echo " order number : ".$subcompinfo["ordno"]."<br />"; /* .. dito if subcomponents exists .. . */ } } } .. .
Directory/filename delimiter.
Default PHP constant DIRECTORY_SEPARATOR. If used, must be set BEFORE filename!
Local directory to store/read iCal files.
Default ".".
Directory must be set BEFORE filename and must exist and be writeable otherwise FALSE is returned. If set using an config array and together with Filename, Directory are set automatically first. When setting Directory, any previously set URL is removed.
Only available in iCalcreator object method getConfig, giving information in array format about directory, filename and filesize.
Example
<?php .. . $fileinfo = $vcalendar->getConfig( "fileinfo" ); .. .
output = array( <directory>, <filename>, <filesize> )
iCal local file name, default created like (if not set):
$filename = date( "YmdHis" ).".ics";
$filename = date( "YmdHis" ).".xml"; // if format set to "xcal"
If not set, filename is created when requested, ex. in iCalcreator object methods saveCalendar or getConfig("filename").
Local filename must be set AFTER setting directory (and opt. delimiter)! Filename (and opt. directory) must be readable/writeable otherwise FALSE is returned.
Only when getting configuration (using iCalcreator object method getConfig).
Returns the size of the file in bytes, to be called
- after "saveCalendar()"
or
- after a "setConfig( "directory" / "filename" )" and before/after "parse()".
Getting the filesize for a remote file (URL) will always return zero.
Format for the iCalcreator object instance output, "iCal"/"xCal", any case.
"iCal" is default ([RFC5545]), "xCal" force xml formatted output, according to
"draft-ietf-calsch-many-xcal-01.txt" (now obsolete).
For converting to and from XML, according to rfc6321, "xCal: The XML Format for iCalendar",use functions
- iCal2XML converts an iCalcreator object instance to XML
- XML2iCal converts XML (string/file) to an iCalcreator object instance.
Language for the iCalcreator object instance and component TEXT value properties as defined in [RFC5646].
Default empty.
If NOT set in TEXT property parameters, language from component instance "setConfig( "language", ..)" method will be used, if set, otherwise language from calendar method "setConfig( "language", ..)" will be used, if set.
The calendar property PRODID is always recreated when setting (calendar) language (, note Unique_id, below).
Character(s) used for carriage return + line feed (CR+LF).
Default "\r\n" as defined in [RFC5545].
Returns array of property names for all set properties in component. "X-PROP" will be used when X-properties are set.
General timezone, will be used if no TZID parameter is supplied when setting DTSTART, DTEND, DUE or RECURRENCE-ID, a TZID auto completion.
Default empty.
Note, some calendar software may also require calendar property X-WR-TIMEZONE and vtimezone component property X-LIC-LOCATION (to be set manually, examine also the createTimezone function).
"Unique_id" is used in calendar property PRODID and component property UID, both created automatically (, if not setting UID manually.
PRODID 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 AUTOMATICALLY generated by using PHP function gethostbyname( $_SERVER["SERVER_NAME"] ) when running in a web server environment or "localhost" when using command line interface. Used when setting other (domain) name than server name.
The calendar property PRODID is always recreated when setting unique_id.
If missing, the component property UID is created at first use of iCalcreator object methods createCalendar, returnCalendar or saveCalendar
A strong recommendation is always to set unique_id, creating a new iCalcreator object or component instance, to ensure accurate creation of all components UID property, also before parse, in case of missing UID.
When reading remote files with URL (using the parse() method), only protocol "http" ("webcal") is supported, i.e. URL must be prefixed by "http://" ("webcal://") and suffixed by a valid filename.
When setting URL, any previously set Directory is removed.
The URL filename part can be retrieved by - getConfig( "filename" ).
When storing a remote iCal file locally, only directory need to be set, filename remains unchanged (i.e. 1. set URL, 2. parse, 3. set directory, 4. saveCalendar).
Example
Parse of remote file, then local save in "depot" folder, using original filename
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "url" => "http://www.iCal.net/depot/calendar.ics" ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $vcalendar->sort(); .. . .. . $vcalendar->setConfig( "directory", "depot" ); $vcalendar->saveCalendar(); .. .
All iCalcreator component object property methods for get/set data.
For property format in detail, see
RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar).
RFC2445: 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.
Notice: date limitation.
Due to a limitation in PHP date functions, e.g. mktime,
strtotime, a date (e.g. while setting DTSTART property)
before "January 1 1970 00:00:00 GMT" may force a PHP date function to generate an error or set date to "January 1 1970".
Format
calendarComponent::deleteProperty( [ PropName [, order ] )
propName = (string) case independent, [RFC5545] component property names, unknown/missing propName will be used as X-property. order = (int) if missing 1st/next occurrence, used with multiply (property) occurrences
Example
Remove all COMMENT properties in first event component.
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "directory" => "import", "filename" => "file.ics" ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $event = $vcalendar->getComponent( "vevent" ); while( $event->deleteProperty( "comment" )) continue; .. .
Generic iCalcreator component get property method, simplifying fetch of properties.
FALSE is returned if no property exists or when end-of-properties at consecutive function calls.
Using the non-standard directive "GEOLOCATION", iCalcreator returns output supporting
ISO6709 "Standard representation of geographic point location by coordinates",
by combining the LOCATION and GEO property values
(only if GEO is set).
Format
calendarComponent::getProperty( PropName [, order [, complete ]] )
propName = (string) case independent, [RFc5545] component property names, unknown/missing propName will be used as X-property. order = (int) if missing/FALSE 1st/next occurrence, otherwise with multiply occurrences (1st=1, 2nd=2.. .) complete - (bool) FALSE (default): output only property value TRUE : output = array("value" => <value> ,"params"=> <parameter array>)
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "directory" => "import", "filename" => "file.ics" ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); while( $vevent = $vcalendar->getComponent( "vevent" )) { $dtstart = $vevent->getProperty( "dtstart" ); // one occurrence $description = $vevent->getProperty( "description" ); // one occurrence while( $comment = $vevent->getProperty( "comment" )) { // MAY occur more than once .. . } } .. .
Parse strict [RFC5545] component property text, in string or array format and starting (!) with property name.
Complete ALARMs, all properties included, in array format and first array row as "BEGIN:VALARM", last as "END:VALARM" as well as TIMEZONE and standard/daylight subcomponents.
If major parse error occurs (like invalid calendar structure or no calendar components), FALSE is returned.
Minor errors like non-standard line-endings, initial and trailing empty lines as well as files without proper end line(-s) (i.e. missing component end iCal directives) are managed.
Except the X-properties, non-standard properties are ignored.
Format
calendarComponent::parse( propertyText )
propertyText = (string) [RFC5545] formatted property, (array) [RFC5545] formatted properties, property name must start string / rows(-s)
example
<?php .. . $vevent = & $vcalendar->newComponent( "vevent" ); $e->parse( "DTSTAMP:19970324T1200Z" ); $e->parse( "SEQUENCE:0" ); $e->parse( "ORGANIZER:MAILTO:jdoe@host1.com" ); $e->parse( array( "ATTENDEE;RSVP=TRUE:MAILTO:jsmith@host1.com", "ATTENDEE;RSVP=TRUE:MAILTO:jsmith@host2.com", "ATTENDEE;RSVP=TRUE:MAILTO:jsmith@host3.com", "ATTENDEE;RSVP=TRUE:MAILTO:jsmith@host4.com" )); $e->parse( "DTSTART:19970324T123000Z" ); $e->parse( "DTEND:19970324T210000Z" ); $e->parse( "CATEGORIES:MEETING,PROJECT" ); $e->parse( "CLASS:PUBLIC" ); $e->parse( "SUMMARY:Calendaring Interoperability Planning Meeting" ); $e->parse( "STATUS:DRAFT" ); $e->parse( array( "DESCRIPTION:Project xyz Review Meeting Minutes" ,"Agenda" ,"1. Review of project version 1.0 requirements." ,"2. Definition of project processes." ,"3. Review of project schedule." ,"Participants: John Smith, Jane Doe, Jim Dandy" ,"- It was decided that the requirements need to be signed off by ". "product marketing." ,"- Project processes were accepted." ,"- Project schedule needs to account for scheduled holidays and employee". " vacation time. Check with HR for specific dates." ,"- New schedule will be distributed by Friday." ,"- Next weeks meeting is cancelled. No meeting until 3/23." )); $e->parse( "LOCATION:LDB Lobby" ); $e->parse( "ATTACH;FMTTYPE=application/postscript:ftp://xyz.com/pub/conf/bkgrnd.ps" ); $e->parse( array( "BEGIN:VALARM", "ACTION:AUDIO", "TRIGGER;VALUE=DATE-TIME:19970224T070000Z", "ATTACH;FMTTYPE=audio/basic:http://host.com/pub/audio-files/ssbanner.aud", "REPEAT:4", "DURATION:PT1H", "X-alarm:non-standard ALARM property", "END:VALARM" )); $e->parse( "X-xomment:non-standard property will be displayed, comma escaped"); .. .
Generic iCalcreator component object set property method, simplifying insert of properties. For properties where multiple occurrences are allowed, last parameter is an index, implementing replaceProperty functionality.
A successful update returns TRUE.
Format
calendarComponent::setProperty( PropName, Proparg_1 *[, Proparg_n] )
propName = (string) case independent, [RFC5545] component property names, unknown propName will be regarded as (a non-standard) X-property. Proparg_n = (mixed) property content Last property argument is a (optional) property dependent parameters array( *[(string) key => (string) value ] ). A non-standard (, experimental) parameter key MUST be prefixed by "X-".
Example
<?php .. . $vevent = & $vcalendar->newComponent( "vevent" ); $vevent->setProperty( "dtstart" , array("year"=>2007,"month"=>4,"day"=>1,"hour"=>19)); $vevent->setProperty( "duration", 0, 0, 3 )); $vevent->setProperty( "LOCATION", "Central Plaza" ); $vevent->setProperty( "summary", "PHP summit" ); .. .
This property defines the action to be invoked when an VALARM is triggered,
"AUDIO" / "DISPLAY" / "EMAIL" / "PROCEDURE".
This property is REQUIRED and MUST NOT occur more than once. ("PROCEDURE" is deprecated in [RFC5545].)
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createAction()
Example
<?php .. . $str = $component->createAction(); .. .
Remove ACTION from component.
Format
calendarComponent::deleteProperty( "Action" )
Example
<?php .. . $valarm->deleteProperty( "Action" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "Action" )
output = actionValue1
Format 2
calendarComponent::getProperty( "Action", FALSE , TRUE )
output = array( "value" => actionValue1 , "params" => xparams2 )
Example
<?php .. . $action = $valarm->getProperty( "action" ); .. .
Insert property value.
Format
calendarComponent::setProperty( "Action", actionValue [, xparams ] )
actionValue1 = (string) one of "AUDIO" / "DISPLAY" / "EMAIL" / "PROCEDURE" xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"
Example
<?php .. . $valarm->setProperty( "action", "DISPLAY" ); .. .
The property provides the capability to associate a document object with a calendar component. The property is is REQUIRED and MUST NOT occur more than once in an "ALARM" ("ACTION" "procedure"), OPTIONAL and MUST NOT occur more than once in an "ALARM" ("ACTION" "audio") and OPTIONAL and MAY occur more than once in VEVENT, VTODO, VJOURNAL and VALARM ("ACTION" "email") components.
The default value type for ATTACH is URI. The value type can also be set to BINARY to indicate inline binary encoded content (params2).
If using other parameters than the recommended "FMTTYPE" and the mandatory "ENCODING" (="BASE64")and "VALUE" (="BINARY") for an inline binary encoded attachment, please use only characters within the ASCII character set in parameter name and content, to ensure proper line folding when using createCalendar and/or returnCalendar.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createAttach()
Example
<?php .. . $str = $component->createAttach(); .. .
Remove ATTACH from component.
Format
calendarComponent::deleteProperty( "ATTACH" )
Example 1
<?php .. . $valarm->deleteProperty( "ATTACH" ); .. .
Example 2
Delete ATTACH property no 2.<?php .. . $valarm->deleteProperty( "ATTACH", 2 ); .. .
Example 3
Deleting all ATTACH properties.<?php .. . while( $valarm->deleteProperty( "ATTACH" )) continue; .. .
If set, returns property value(-s), otherwise FALSE.
Format 1
calendarComponent::getProperty( "Attach" )
output = attachValue1
Format 2
calendarComponent::getProperty( "ATTACH", propOrderNo/FALSE , TRUE )
propOrderNo = (int) specific property value,
output = array( "value" => attachValue1 , "params" => params2 )
Format 3
calendarComponent::getProperty( "Attach", propOrderNo )
propOrderNo = (int) specific property value
Get propOrderNo ATTACH
Example
<?php .. . $attach = $valarm->getProperty( "attach" ); .. .
Insert property value. Parameters, if any, will be ordered as prescribed in [RFC5545].
Format
calendarComponent::setProperty( "attach", attachValue1 [, params [, propOrderNo ]] )
attachValue1 = (string) URI / inline binary encoded content params2 = (array ) ( [ "ENCODING" => "BASE64", "VALUE" => "BINARY" ] [, "FMTTYPE" => contentType ] *[, xparams ] ) contentType = (string) The parameter value MUST be the TEXT for either an IANA registered content type or a non-standard content type. xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc
Example
<?php .. . $vevent->setProperty( "attach" , "ftp://domain.com/pub/docs/agenda.doc" , array( "FMTTYPE" => "application/binary" )); .. .
The property defines an "Attendee" within a calendar component and is OPTIONAL and MUST NOT occur more than once in a VALARM ("ACTION" "email"), OPTIONAL and MAY occur more than once in VEVENT, VTODO, VJOURNAL and VFREEBUSY components.
This value type for ATTENDEE is URI, a calendar user address.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createAttendee()
Example
<?php .. . $str = $component->createAttendee(); .. .
Remove ATTENDEE from component.
Format
calendarComponent::deleteProperty( "ATTENDEE" )
Example 1
Delete (single/first) ATTENDEE property
<?php .. . $valarm->deleteProperty( "ATTENDEE" ); .. .
Example 2
Delete ATTENDEE property no 2.
<?php .. . $valarm->deleteProperty( "ATTENDEE", 2 ); .. .
Example 3
Deleting all ATTENDEE properties.<?php .. . while( $valarm->deleteProperty( "ATTENDEE" )) continue; .. .
If set, returns property value(-s), otherwise FALSE.
Format 1
calendarComponent::getProperty( "Attendee" )
output = attendeeValue1
Format 2
calendarComponent::getProperty( "ATTENDEE", propOrderNo/FALSE , TRUE )
propOrderNo = (int) specific property value
output = array( "value" => attendeeValue1 , "params" => array( params2 ))
Format 3
calendarComponent::getProperty( "ATTENDEE", propOrderNo )
propOrderNo = (int) specific property value
output = attendeeValue1
Example
<?php .. . $attendee = $valarm->getProperty( "attendee" ); .. .
Insert property value. If exist, default parameter values are removed after input (params2). Property value must be prefixed by protocol (ftp://, http://,mailto:, file://.. . ref. rfc 1738 ), if missing, "mailto:" is set (indicating an internet mail address). Also MEMBER and DIR parameters must be prefixed by protocol. DELEGATED-TO, DELEGATED-FROM, SENT-BY parameters must use protocol "mailto:", prefixed if missing (indicating an internet mail address).
Parameters, if any, will be ordered as prescribed in [RFC5545].
Format
calendarComponent::setProperty( "attendee", attendeeValue [, params [, propOrderNo ]] )
attendeeValue1 = (string) a calendar user address, a URI as defined by [RFC 1738] or any other IANA registered form for a URI. params2 = (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) / (string) x-name (Experimental type) / iana-token (string) (Other IANA registered type) MEMBER = "MEMBER" => array( *[ (string) "single member of the group or list membership"]) ROLE = "ROLE" => "CHAIR" (Indicates chair of the calendar entity) / "REQ-PARTICIPANT" (required participation, Default) / "OPT-PARTICIPANT" (optional participation) / "NON-PARTICIPANT" (information purposes only) / (string) x-name (Experimental role) / (string) 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) / (string) x-name (Experimental status) / (string) iana-token (Other IANA registered status) RSVP = "RSVP" => (string) "TRUE" / "FALSE", Default (reply expectation) DELEGATED-TO = "DELEGATED-TO" => array(*[(string) "single calendar user to specified by the property has delegated participation"]) DELEGATED-FROM = "DELEGATED-FROM" => array( *[ (string) "single calendar user that have delegated their participation to the calendar user specified by the property" ] ) SENT-BY = "SENT-BY" => (string) single calendar user that is acting on behalf of the calendar user specified by the property" LANGUAGE = "LANGUAGE" => (string) "lang*" (applies to the CN parameter value) CN = "CN" => (string) "common name to be associated with the calendar user specified by the property" DIR = "DIR" => (string) "reference to a directory entry associated with the calendar user specified by the property" xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5646]
See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar).
Example
<?php .. . $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( "cio@ical.net" , "vice.cio@ical.net") , "SENT-BY" => "secretary@ical.net" , "LANGUAGE" => "us-EN" , "CN" => "John Doe" , "DIR" => "http://www.ical.net/info.doc" , "x-agenda" => "status reports" // xparam , "x-length" => "15 min" )); // xparam .. .
This property defines the categories for a calendar component and is OPTIONAL and MAY occur more than once in VEVENT, VTODO and VJOURNAL components.
The value type for CATEGORIES is TEXT.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createCategories()
Example
<?php .. . $str = $component->createCategories(); .. .
Remove CATEGORIES from component.
Format
calendarComponent::deleteProperty( "CATEGORIES" )
Example 1
Delete (single/first) CATEGORIES property
<?php .. . $vevent->deleteProperty( "CATEGORIES" ); .. .
Example 2
Delete CATEGORIES property no 2.
<?php .. . $vevent->deleteProperty( "CATEGORIES", 2 ); .. .
Example 3
Deleting all CATEGORIES properties.
<?php .. . while( $vevent->deleteProperty( "CATEGORIES" )) continue; .. .
If set, returns property value(-s), otherwise FALSE.
Format 1
calendarComponent::getProperty( "CATEGORIES" )
output = categoryValue1
Format 2
calendarComponent::getProperty( "CATEGORIES", propOrderNo/FALSE , TRUE )
propOrderNo = (int) specific property value
output = array( "value" => categories1 , "params" => params3 )
Format 3
calendarComponent::getProperty( "CATEGORIES", propOrderNo )
propOrderNo = (int) specific property value
Get propOrderNo CATEGORIES
Example
<?php .. . $categories = $valarm->getProperty( "categories" ); .. .
Insert property value. Parameters, if any, will be ordered as prescribed in [RFC5545].
Format
calendarComponent::setProperty( "categories", categories [, params [, propOrderNo ]] )
categories1 = (string) categoryValue / (array) ( *categoryValue ) categoryValue2 = (string) textual categories or subtypes of the calendar component, can be specified as a list of categories separated by the COMMA character params3 = (array) ( ["LANGUAGE" => (string) "<lang*>"] *[, xparams] ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5646]
Example
<?php .. . $vevent->setProperty( "categories", "project_x" ); .. .
This property defines the access classification for a calendar component and is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO and VJOURNAL components.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createClass()
Example
<?php .. . $str = $component->createClass(); .. .
Remove CLASS from component.
Format
calendarComponent::deleteProperty( "CLASS" )
Example
<?php .. . $vjournal->deleteProperty( "CLASS" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "CLASS" )
output = classValue1
Format 2
calendarComponent::getProperty( "CLASS", FALSE , TRUE )
output = array "value" => classValue1 , "params" => xparams2 )
Example
<?php .. . $class = $valarm->getProperty( "class" ); .. .
Insert property value.
Format
calendarComponent::setProperty( "class", classvalue [, xparams ] )
classvalue1 = "PUBLIC" / "PRIVATE" / "CONFIDENTIAL" / (string) iana-token / (string) x-name xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"
Example
<?php .. . $vevent->setProperty( "class", "CONFIDENTIAL" ); .. .
This property specifies non-processing information intended to provide a comment to the calendar user and is OPTIONAL and MAY occur more than once in VEVENT, VTODO, VJOURNAL, VFREEBUSY, STANDARD and DAYLIGHT components.
The value type for COMMENT is TEXT.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createComment()
Example
<?php .. . $str = $component->createComment(); .. .
Remove COMMENT from component.
Format
calendarComponent::deleteProperty( "COMMENT" )
Example 1
Delete (single/first) COMMENT property
<?php .. . $vevent->deleteProperty( "COMMENT" ); .. .
Example 2
Delete COMMENT property no 2.
<?php .. . $vevent->deleteProperty( "COMMENT", 2 ); .. .
Example 3
Deleting all COMMENT properties.
<?php .. . while( $vevent->deleteProperty( "COMMENT" )) continue; .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "COMMENT" )
output = commentValue1
Format 2
calendarComponent::getProperty( "COMMENT", propOrderNo/FALSE , TRUE )
propOrderNo = (int) specific property value
output = array( "value" => commentValue1 , "params" => params2 )
Format 3
calendarComponent::getProperty( "COMMENT", propOrderNo )
propOrderNo = (int) specific property value
Get propOrderNo COMMENT
Example
<?php .. . $comment = $vevent->getProperty( "comment" ); .. .
Insert property value. Parameters, if any, will be ordered as prescribed in [RFC5545].
Format
calendarComponent::setProperty( "comment", commentValue [, params [, propOrderNo ]] )
commentValue1 = (string) Value type Text params2 = (array) ( [ "ALTREP" => (string) "<an alternate text representation, URI>"] [, "LANGUAGE" => (string) "lang*"] *[, xparams ] ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5646]
Example
<?php .. . $vevent->setProperty( "comment", "this is a comment" ); .. .
This property defines the date and time that a VTODO was actually completed and is OPTIONAL and MUST NOT occur more than once.
The value type for COMPLETED is UTC DATE-TIME.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createCompleted()
Example
<?php .. . $str = $component->createCompleted(); .. .
Remove COMPLETED from component.
Format
calendarComponent::deleteProperty( "COMPLETED" )
Example
<?php .. . $vtodo->deleteProperty( "COMPLETED" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "COMPLETED" )
output = completedDate1
Format 2
calendarComponent::getProperty( "COMPLETED", FALSE , TRUE )
output = array( "value" => completedDate1 , "params" => xparams2 )
Example
<?php .. . $completed = $vtodo->getProperty( "completed" ); .. .
Insert property value. Input date is always a UTC DATE-TIME or, if "offset" parameter is used, converted to a UTC DATE-TIME. Notice, use function transformDateTime to change a local datetime to UTC datetime.
Format
calendarComponent::setProperty( "completed", completedDate [, xparams ] )
completedDate1 = (array) ( "year" => (int) year
, "month" => (int) month
, "day" => (int) day
[, "hour" => (int) hour
, "min" => (int) min
, "sec" => (int) sec
, "tz" => offset ]] )
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
[, offset ]] )
completedDate = (array) ( "timestamp" => (int) timestamp ) // results in a UTC DATE-TIME
completedDate = (string) date/datetime string*
offset = (int) (+/-)HHmm[ss] // (arr/str) local date + UTC offset will result in a UTC DATE-TIME
xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"
date/datetime string* recommended formats
"20110625", "2011-06-25", "2011/06/26"
"20110625051015", "20110625 051015"
"20110625T051015", "20110625t051015"
"2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15"
"2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15"
trailing characters (digits), if exists, will be interpreted as offset
other string formats, acceptable by PHP strtotime function, may (would) work
(notice date restriction)
Example 1
<?php .. . $config = array( "unique_id" => "kigkonsult.se"); $vcalendar = new vcalendar( $config ); $vtodo = & $vcalendar->newComponent( "vtodo" ); .. . $vtodo->setProperty( "completed", 2006, 8, 10, 10, 0, 0 ); // 10 august 2006 10.00 UTC .. .
Example 2
<?php .. . $date = array("year" => 2006, "month" => 10, "day" => 10, "hour" => 10, "min" => 0, "sec" => 0, "tz" => "+0200"); // local date + UTC offset will result in a UTC DATE-TIME $vtodo->setProperty( "completed", $date ); .. .
The property is used to represent textual contact information or alternately a reference to textual contact information associated with the calendar component. The property is OPTIONAL and MUST NOT occur more than once in a VFREEBUSY or MAY occur more than once in VEVENT, VTODO and VJOURNAL components.
The value type for CONTACT is TEXT.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createContact()
Example
<?php .. . $str = $component->createContact(); .. .
Remove CONTACT from component.
Format
calendarComponent::deleteProperty( "CONTACT" )
Example 1
Delete (single/first) CONTACT property
<?php .. . $vevent->deleteProperty( "CONTACT" ); .. .
Example 2
Delete CONTACT property no 2.
<?php .. . $vevent->deleteProperty( "CONTACT", 2 ); .. .
Example 3
Deleting all CONTACT properties.
<?php .. . while( $vevent->deleteProperty( "CONTACT" )) continue; .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "CONTACT" )
output = contactValue1
Format 2
calendarComponent::getProperty( "CONTACT", propOrderNo/FALSE , TRUE )
propOrderNo = (int) specific property value
output = array( "value" => contactValue1 , "params" => params2 )
Format 3
calendarComponent::getProperty( "CONTACT", propOrderNo )
propOrderNo = (int) specific property value
Get propOrderNo CONTACT
Example
<?php .. . $contact = $vevent->getProperty( "contact" ); .. .
Insert property value. Parameters, if any, will be ordered as prescribed in [RFC5545].
Format
calendarComponent::setProperty( "contact", contactValue [, params [, propOrderNo ]] )
contactValue1 = (string) Value type TEXT params2 = (array) ( [ "ALTREP" => (string) "<an alternate text representation, URI>"] [, "LANGUAGE" => (string) "lang*"] *[, xparams] ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5646]
Example
<?php .. . $c->setProperty( "contact", "tel 012-34 56 789" ) .. .
This property specifies the date and time that the calendar information was created by the calendar user agent in the calendar store. Note: This is analogous to the creation date and time for a file in the file system. The property is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO and VJOURNAL components.
The value type for CREATED is UTC DATE-TIME.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createCreated()
Example
<?php .. . $str = $component->createCreated(); .. .
Remove CREATED from component.
Format
calendarComponent::deleteProperty( "CREATED" )
Example
<?php .. . $vevent->deleteProperty( "CREATED" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "CREATED" )
output = createdDate1
Format 2
calendarComponent::getProperty( "CREATED", FALSE , TRUE )
output = array( "value" => createdDate1 , "params" => xparams2 )
Example
<?php .. . $created = $vevent->getProperty( "CREATED" ); .. .
Insert property value. Input date is always a UTC DATE-TIME or, if "offset" parameter is used, converted to a UTC DATE-TIME. Notice, use function transformDateTime to change a local datetime to UTC datetime.
Format
calendarComponent::setProperty( "created", [ createdDate [, xparams ]] )
createdDate1 = (array) ( "year" => (int) year
, "month" => (int) month
, "day" => (int) day
[, "hour" => (int) hour
, "min" => (int) min
, "sec" => (int) sec
, "tz" => offset ]] )
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
[, offset ]] )
createdDate = (array) ( "timestamp" => (int) timestamp ) // results in a UTC DATE-TIME
createdDate = (string) date/datetime string*
offset = (int) (+/-)HHmm[ss] // (arr/str) local date + UTC offset will result in a UTC DATE-TIME
xparams2 = array( *[ (string) key => (string) value ] ) // key prefix "X-"
date/datetime string* recommended formats
"20110625", "2011-06-25", "2011/06/26"
"20110625051015", "20110625 051015"
"20110625T051015", "20110625t051015"
"2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15"
"2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15"
trailing characters (digits), if exists, will be interpreted as offset
other string formats, acceptable by PHP strtotime function, may (would) work
(notice date restriction)
Example 1
<?php .. . $config = array( "unique_id" => "kigkonsult.se" ); $vcalendar = new vcalendar( $config ); $vtodo = & $vcalendar->newComponent( "vtodo" ); .. . $vtodo->setProperty( "created", 2006, 8, 11, 14, 30, 35 ); // 11 august 2006 14.30.35 UTC .. .
Example 2
<?php .. . $date = array("year" => 2006, "month" => 10, "day" => 10, "hour" => 10, "min" => 0, "sec" => 0, "tz" => "+0200"); // local date + UTC offset will result in a UTC DATE-TIME $vtodo->setProperty( "created", $date ); .. .
Example 3
<?php .. . $vevent->setProperty( "created" ); // current UTC date-time is set if called without parameters .. .
This property provides a more complete textual description of the calendar component, than that provided by the SUMMARY property (, analogous to a mail BODY). The property is OPTIONAL, MUST NOT occur more than once within VEVENT, VTODO or VALARM (PROCEDURE) but can be specified multiple times within a VJOURNAL calendar component. The property is REQUIRED in VALARM (DISPLAY, EMAIL) component.
The value type for DESCRIPTION is TEXT.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createDescription()
Example
<?php .. . $str = $component->createDescription(); .. .
Remove DESCRIPTION from component.
Format
calendarComponent::deleteProperty( "DESCRIPTION" )
Example 1
Delete (single/first) DESCRIPTION property.
<?php .. . $vevent->deleteProperty( "DESCRIPTION" ); .. .
Example 2
Delete DESCRIPTION property no 2.
<?php .. . $vjournal->deleteProperty( "DESCRIPTION", 2 ); .. .
Example 3
Deleting all DESCRIPTION properties.
<?php .. . while( $vjournal->deleteProperty( "DESCRIPTION" )) continue; .. .
If set, returns property value(-s), otherwise FALSE.
Format 1
calendarComponent::getProperty( "DESCRIPTION" )
output = descriptionValue1
Format 2
calendarComponent::getProperty( "DESCRIPTION", FALSE , TRUE )
output = array( "value" => descriptionValue1 , "params" => params2 )
Example
<?php .. . $description = $vevent->getProperty( "description" ); .. .
Insert property value.
Format
calendarComponent::setProperty( "description", descriptionValue [, params [, propOrderNo ]] )
descriptionValue1 = (string) Value type TEXT params2 = (array) ( [ "ALTREP" => (string) "<an alternate text representation, URI>"] [, "LANGUAGE" => (string) "lang*"] *[, xparams ] ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5646]
Example
<?php .. . $vevent->setProperty( "description", "This is a description" ); .. .
This property specifies the date and time that a calendar component ends. The property is OPTIONAL and MUST NOT occur more than once in VFREEBUSY and VEVENT. In VEVENT, it only occurs if DURATION NOT occurs.
The default value type for DTEND is DATE-TIME, can be set to a DATE value type.
The value type of the "DTEND" or "DUE" properties MUST match the value type of "DTSTART" property as defined in [RFC5545])
Notice that an end date without a time is in effect midnight of the day before the date,
so for timeless dates, use the date following the event date for it to be correct.
For an "all-day event" and using timeless dates, the DTEND is equal DTSTART plus one day,
example all-day event (2007-12-01)
DTSTART;VALUE=DATE:20071201
DTEND;VALUE=DATE:20071202.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createDtend()
Example
<?php .. . $str = $component->createDtend(); .. .
Remove DTEND from component.
Format
calendarComponent::deleteProperty( "DTEND" )
Example
<?php .. . $vevent->deleteProperty( "DTEND" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "DTEND" )
output = dtendDate1
Format 2
calendarComponent::getProperty( "DTEND", FALSE , TRUE )
output = array( "value" => dtendDate1 , "params" => params2 )
Example
<?php .. . $dtend = $vevent->getProperty( "dtend" ); .. .
Insert property value. If DATE value type is expected, "VALUE" = "DATE" must be set (in params2) otherwise DATE-TIME (default) value type is set.
If no timezone parameter (tz or tzidparam below) is set (i.e.local time) and config TZID is set, date-time values will be set WITH timezone from config. Notice, use function transformDateTime to change a datetime from one time zone to another.
Parameters, if any, will be ordered as prescribed in [RFC5545].
Format
calendarComponent::setProperty( "dtend", dtendDate [, params2 ] )
dtendDate1 = (array) ( "year" => (int) year
, "month" => (int) month
, "day" => (int) day
[, "hour" => (int) hour
, "min" => (int) min
, "sec" => (int) sec
[, "tz" => tz ]] )
dtendDate = (int) year
, (int) month
, (int) day
[, (int) hour
, (int) min
, (int) sec
[, tz ]]
dtendDate = array( (int) year
, (int) month
, (int) day
[, (int) hour
, (int) min
, (int) sec
[, tz ]] )
dtendDate = (array) ( "timestamp" => (int) timestamp [,"tz" => tz])
// timestamp without tz will result in a UTC DATE-TIME
dtendDate = (string) date/datetime string*
// Within the "VFREEBUSY" calendar component,
// the time MUST be specified in the UTC DATE-TIME
tz = (string) <timezone identifier> / offset
// timezone will be used as tzidparam (below), if tzidparam not set
offset = (int) (+/-)HHmm[ss] // (arr/str) local date + UTC offset will result in a UTC DATE-TIME
params2 = (array) ([ tzidparam/datetimeparam/dateparam ] *[,xparams])
tzidparam = "TZID" => (string) <timezone identifier>
// output as local date-time with timezone identifier
// if tzidparam="GMT"/"UTC" then
// output date-time is suffixed by 'Z'
datetimeparam = "VALUE" => "DATE-TIME" // default, output as date-time
dateparam = "VALUE" => "DATE" // output as DATE, ex. all-day event
xparams = (string) key => (string) value // key prefix "X-"
date/datetime string* recommended formats
"20110625", "2011-06-25", "2011/06/26"
"20110625051015", "20110625 051015"
"20110625T051015", "20110625t051015"
"2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15"
"2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15"
trailing characters (digits), if exists, will be interpreted as offset/timezone
other string formats, acceptable by PHP strtotime function, may (would) work
(notice date restriction)
Example 1
<?php .. . $vevent->setProperty( "dtend", 2006, 8, 11, 16, 30, 0 ); // 11 august 2006 16.30.00 local date .. .
Example 2
<?php .. . $vfreebusy->setProperty( "dtend", 2006, 8, 11, 16, 30, 0, "-040000" ); // 11 august 2006 16.30.00 -040000 // local date + UTC offset will result in a UTC DATE-TIME .. .
Example 3
<?php .. . $vevent->setProperty( "dtend" , array( "year" =>, 2006, "month" => 8, "day"=> 11 ) , array( "VALUE" => "DATE" )); // end of an all-day event .. .
Example 4
<?php .. . $calendar->setConfig( 'TZID', 'Europe/Stockholm' ); .. . $vevent->setProperty( "dtend", 2006, 8, 11, 7, 30, 0 ); // output: DTEND;TZID=Europe/Stockholm:20060811T073000 .. .
The property indicates the date/time that the instance of the iCalendar object was created and is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO, VJOURNAL and VFREEBUSY components. However, DTSTAMP is AUTOMATICALLY GENERATED in iCalcreator.
DTSTAMP may be required when importing iCal files into some calendar software
(MS etc.),
as well as (calendar) x-properties "X-WR-CALNAME", "X-WR-CALDESC" and
"X-WR-TIMEZONE",
METHOD property (value PUBLISH etc.) and the (also created) UID property.
The value type for DTSTAMP is UTC DATE-TIME.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createDtstamp()
Example
<?php .. . $str = $component->createDtstamp(); .. .
If DTSTAMP if removed from a component, DTSTAMP will automatically be recreated when iCalcreator object output methods like createDtstamp (above), createCalendar, returnCalendar or saveCalendar is executed.
Format
calendarComponent::deleteProperty( "DTSTAMP" )
Example
<?php .. . $vevent->deleteProperty( "DTSTAMP" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "DTSTAMP" )
output = dtstampDate1
Format 2
calendarComponent::getProperty( "DTSTAMP", FALSE , TRUE )
output = array( "value" => dtstampDate1 , "params" => xparams2 )
Example
<?php .. . $dtstamp = $vevent->getProperty( "dtstamp" ); .. .
Insert property value. Input date is always a UTC DATE-TIME or, if "offset" parameter is used, converted to a UTC DATE-TIME. Notice, use function transformDateTime to change a (local) datetime to UTC time zone.
Format
calendarComponent::setProperty( "dtstamp", dtstampDate [, xparams ] )
dtstampDate1 = (array) ( "year" => (int) year
, "month" => (int) month
, "day" => (int) day
[, "hour" => (int) hour
, "min" => (int) min
, "sec" => (int) sec
, "tz" => offset ]] )
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
[, offset ]] )
dtstampDate = (array) ( "timestamp" => (int) timestamp ) // will result in a UTC DATE-TIME
dtstampDate = (string) (string) date/datetime string*
offset = (int) (+/-)HHmm[ss] // (arr/str) local date + UTC offset will result in a UTC DATE-TIME
xparams2 = array( *[ (string) key => (string) value ] ) // key prefix "X-"
date/datetime string* recommended formats
"20110625", "2011-06-25", "2011/06/26"
"20110625051015", "20110625 051015"
"20110625T051015", "20110625t051015"
"2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15"
"2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15"
trailing characters (digits), if exists, will be interpreted as offset
other string formats, acceptable by PHP strtotime function, may (would) work
(notice date restriction)
Example 1
<?php .. . $config = array( "unique_id" => "kigkonsult.se" ); $vcalendar = new vcalendar( $config ); $vtodo = & $vcalendar->newComponent( "vtodo" ); .. . $vtodo->setProperty( "dstamp", 2006, 8, 11, 7, 30, 1 ); // 11 august 2006 07.30.01 UTC .. .
Example 2
<?php .. . $date = array("year" => 2006, "month" => 10, "day" => 10, "hour" => 10, "min" => 0, "sec" => 0, "tz" => "+0200"); // local date + UTC offset will result in UTC DATE-TIME $vtodo->setProperty( "dtstamp", $date ); .. .
This property specifies when the calendar component begins. The property is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO, VJOURNAL and VFREEBUSY components. The property is REQUIRED, but MUST NOT occur more than once in STANDARD and DAYLIGHT components.
The default value type for DTSTART is DATE-TIME, can be set to a DATE value type.
For an "all-day event" and using timeless dates, example (2007-12-01)
DTSTART;VALUE=DATE:20071201
DTEND;VALUE=DATE:20071202. // opt., in effect midnight of the day before the date!!
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createDtstart()
Example
<?php .. . $str = $component->createDtstart(); .. .
Remove DTSTART from component.
Format
calendarComponent::deleteProperty( "DTSTART" )
Example
<?php .. . $vevent->deleteProperty( "DTSTART" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "DTSTART" )
output = dtstartDate1
Format 2
calendarComponent::getProperty( "DTSTART", FALSE , TRUE )
output = array( "value" => dtstartDate1 , "params" => params2 )
Example
<?php .. . $dtstart = $vevent->getProperty( "dtstart" ); .. .
Insert property value. If DATE value type is expected, "VALUE" = "DATE" must be set (in params2) otherwise DATE-TIME (default) value type is set.
If no timezone parameter (tz or tzidparam below) is set (i.e.local time) and config TZID is set, date-time values will be set WITH timezone from config. Notice, use function transformDateTime to change a datetime from one time zone to another.
Parameters, if any, will be ordered as prescribed in [RFC5545].
Format
calendarComponent::setProperty( "dtstart", dtstartDate [, params ] )
dtstartDate1 = (array) ( "year" => (int) year
, "month" => (int) month
, "day" => (int) day
[, "hour" => (int) hour
, "min" => (int) min
, "sec" => (int) sec
[, "tz" => tz ]] )
dtstartDate = (int) year
, (int) month
, (int) day
[, (int) hour
, (int) min
, (int) sec
[, tz ]]
dtstartDate = (array) ( (int) year
, (int) month
, (int) day
[, (int) hour
, (int) min
, (int) sec
[, tz ]] )
dtstartDate = (array) ("timestamp" => (int) timestamp [, "tz" => tz])
// timestamp without tz will result in a UTC DATE-TIME
dtstartDate = (string) date/datetime string*
// Within the "VFREEBUSY" calendar component,
// the dtstartDate MUST be specified in the UTC DATE-TIME
tz = (string) <timezone identifier> / offset
// timezone will be used as tzidparam (below), if tzidparam not set
offset = (int) (+/-)HHmm[ss] // (arr/str) local date + UTC offset will result in a UTC DATE-TIME
params2 = (array) ([ tzidparam/datetimeparam/dateparam ] *[, xparams])
tzidparam = "TZID" => (string) <timezone identifier>
// output as local date-time with timezone identifier
// if tzidparam="GMT"/"UTC" then
// output date-time is suffixed by 'Z'
datetimeparam = "VALUE" => "DATE-TIME" // default, output as date-time
dateparam = "VALUE" => "DATE" // output as DATE, ex. all-day event
xparams = (string) key => (string) value // key prefix "X-"
date/datetime string* recommended formats
"20110625", "2011-06-25", "2011/06/26"
"20110625051015", "20110625 051015"
"20110625T051015", "20110625t051015"
"2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15"
"2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15"
trailing characters (digits), if exists, will be interpreted as offset/timezone
other string formats, acceptable by PHP strtotime function, may (would) work
(notice date restriction)
Example 1
<?php .. . $vevent->setProperty( "dstart", 2006, 8, 11, 7, 30, 1 ); // 11 august 2006 07.30.01 local date .. .
Example 2
<?php .. . $vevent->setProperty( "dstart", 2006, 8, 11, 16, 30, 0, "-040000" ); // 11 august 2006 16.30.00 -040000 // local date + UTC offset will result in a UTC DATE-TIME .. .
Example 3
<?php .. . $vevent->setProperty( "dtstart" , array( "year" =>, 2006, "month" => 8, "day"=> 11 ) , array( "VALUE" => "DATE" )); // start of an all-day event, or a period of (entire) days .. .
Example 4
<?php .. . $calendar->setConfig( 'TZID', 'Europe/Stockholm' ); .. . $vevent->setProperty( "dstart", 2006, 8, 11, 7, 30, 0 ); // output: DTSTART;TZID=Europe/Stockholm:20060811T073000 .. .
This property defines the date and time when a VTODO is expected to be completed and is OPTIONAL and MUST NOT occur more than once and only if DURATION NOT occurs.
The default value type for DUE is DATE-TIME, can be set to a DATE value type.
The value type of the "DTEND" or "DUE" properties MUST match the value type of "DTSTART" property as defined in [RFC5545])
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createDue()
Example
<?php .. . $str = $component->createDue(); .. .
Remove DUE from component.
Format
calendarComponent::deleteProperty( "DUE" )
Example
<?php .. . $vtodo->deleteProperty( "DUE" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "DUE" )
output = dueDate1
Format 2
calendarComponent::getProperty( "DUE", FALSE , TRUE )
output = array( "value" => dueDate1 , "params" => params2 )
Example
<?php .. . $due = $vtodo->getProperty( "due" ); .. .
Insert property value. If DATE value type is expected, "VALUE" = "DATE" must be set (in params2) otherwise DATE-TIME (default) value type is set.
If no timezone parameter (tz or tzidparam below) is set (i.e.local time) and config TZID is set, date-time values will be set WITH timezone from config. Notice, use function transformDateTime to change a datetime from one time zone to another.
Parameters, if any, will be ordered as prescribed in [RFC5545].
Format
calendarComponent::setProperty( "due", dueDate [, params ] )
dueDate1 = (array) ( "year" => (int) year
, "month" => (int) month
, "day" => (int) day
[, "hour" => (int) hour
, "min" => (int) min
, "sec" => (int) sec
[, "tz" => tz ]] )
dueDate = (int) year
, (int) month
, (int) day
[, (int) hour
, (int) min
, (int) sec
[, tz ]]
dueDate = (array) ( (int) year
, (int) month
, (int) day
[, (int) hour
, (int) min
, (int) sec
[, tz ]] )
dueDate = (array) ( "timestamp" => (int) timestamp [, "tz" => tz])
// timestamp without tz will result in a UTC DATE-TIME
dueDate = (string) date/datetime string*
tz = (string) <timezone identifier> / offset
// timezone will be used as tzidparam (below), if tzidparam not set)
offset = (int) (+/-)HHmm[ss] // (arr/str) local date + UTC offset will result in UTC DATE-TIME
params2 = (array) ([ tzidparam/datetimeparam/dateparam ] *[, xparams])
tzidparam = "TZID" => (string) <timezone identifier>
// output as local date-time with timezone identifier
// if tzidparam="GMT"/"UTC" then
// output date-time is suffixed by 'Z'
datetimeparam = "VALUE" => "DATE-TIME" // default, output as date-time
dateparam = "VALUE" => "DATE" // output as DATE, "during the day"
xparams = (string) key => (string) value // key prefix "X-"
date/datetime string* recommended formats
"20110625", "2011-06-25", "2011/06/26"
"20110625051015", "20110625 051015"
"20110625T051015", "20110625t051015"
"2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15"
"2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15"
trailing characters (digits), if exists, will be interpreted as offset/timezone
other string formats, acceptable by PHP strtotime function, may (would) work
(notice date restriction)
Example 1
<?php .. . $vtodo->setProperty( "due", 2006, 8, 11, 18, 0, 0 ); // 11 august 2005 18.00.00 local date .. .
Example 2
<?php .. . $vtodo->setProperty( "due" , 2006, 8, 11, 16, 30, 0, "-040000" ); // 11 august 2006 16.30.00 -040000 // local date + UTC offset will result in a UTC DATE-TIME .. .
Example 3
<?php .. . $vtodo->setProperty( "due" , array( "year" =>, 2006, "month" => 8, "day"=> 11 ) , array( "VALUE" => "DATE" )); // due "during the day" .. .
Example 4
<?php .. . $calendar->setConfig( 'TZID', 'Europe/Stockholm' ); .. . $vevent->setProperty( "due", 2006, 8, 11, 7, 30, 0 ); // output: DUE;TZID=Europe/Stockholm:20060811T073000 .. .
The property specifies a positive duration of time.
If any hour/minute/second duration part is set, all parts are included in output (ex. one hour duration: "PT1H0M0S").
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createDuration()
Example
<?php .. . $str = $component->createDuration(); .. .
Remove DURATION from component.
Format
calendarComponent::deleteProperty( "DURATION" )
Example
<?php .. . $valarm->deleteProperty( "DURATION" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "DURATION" )
output = duration1
Format 2
calendarComponent::getProperty( "DURATION", FALSE , TRUE )
output = array( "value" => duration1 , "params" => xparams2 )
Example
<?php .. . $duration = $vtodo->getProperty( "duration" ); .. .
option
If a 4th argument is used and set to TRUE, returned output is in a DATE-TIME output format (like DTEND / DUE), based on DTSTART value with the added DURATION value.
Insert property value.
Format
calendarComponent::setProperty( "duration", duration [, xparams ] )
duration1 = (array) ( "week" => (int) week ) duration1 = array ( "day" => (int) day ) [, "hour" => (int) hour , "min" => (int) min , "sec" => (int) sec ]) duration = (array) ( "sec" => (int) sec ) duration = (array) ( (int) week/false [, (int) day/false [, (int) hour , (int) min , (int) sec ]] ) duration = (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" xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"
Example 1
One day duration.
<?php .. . $vtodo->setProperty "duration" , array( "day" => 1 )); .. .
Example 2
Four hours duration.
<?php .. . $vtodo->setProperty( "duration", "PT4H" ); .. .
This property defines the list of date/time exceptions for a recurring calendar component and is OPTIONAL and MAY occur more than once in VEVENT, VTODO, VJOURNAL components.
The default value type for EXDATE is DATE-TIME, can be set to a DATE value type.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createExdate()
Example
<?php .. . $str = $component->createExdate(); .. .
Remove EXDATE from component.
Format
calendarComponent::deleteProperty( "EXDATE" )
Example 1
<?php .. . $vtodo->deleteProperty( "EXDATE" ); .. .
Example 2
Delete EXDATE property no 2.
<?php .. . $vjournal->deleteProperty( "EXDATE", 2 ); .. .
Example 3
Deleting all EXDATE properties.
<?php .. . while( $vjournal->deleteProperty( "EXDATE" )) continue; .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "EXDATE" )
output = exdates1
Format 2
calendarComponent::getProperty( "exdate", propOrderNo/FALSE, TRUE )
propOrderNo = (int) specific property value
output = array( "value" => exdates1 , "params" => xparams2 )
Format 3
calendarComponent::getProperty( "EXDATE", propOrderNo )
propOrderNo = (int) specific property value
Get propOrderNo EXDATE
Example
<?php .. . $exdate = $vtodo->getProperty( "exdate" ); .. .
Insert property value.
If DATE value type is set in params ("VALUE" = "DATE"), all timezone or offset in dates are ignored.
If no "VALUE" value type is set or if DATE-TIME value type or TZID value is set in params, DATE-TIME (default) value type is set.
If "TZID" is set in params,
all timezone or offset in dates are ignored (note timestamp, below) and DATE-TIME value type is set.
If empty params and offset in 1st date, all remaining (non-timestamp) dates are set to UTC.
If no "TZID" is set in params and timezone in 1st date, all remaining dates are within this timezone and param "TZID" is set.
If none of the above rules are applicable, DATE-TIME and local date is set default.
Inserted EXDATEs are automatically sorted in ascending order (Y-m-d[-H-i-s]).
Notice, use function transformDateTime to convert a datetime from one time zone to another.
Parameters, if any, will be ordered as prescribed in [RFC5545].
Format
calendarComponent::setProperty( "exdate", exdates [, params [, propOrderNo ]] )
exdates1 = (array) ( date *[, date ] )
date = array( (int) year
, (int) month
, (int) day
[, (int) hour
, (int) min
, (int) sec
[, tz ]] )
date1 = (array) ( "year" => (int) year
, "month" => (int) month
, "day" => (int) day
[, "hour" => (int) hour
, "min" => (int) min
, "sec" => (int) sec
[, "tz" => tz ]] )
date = (array) ( "timestamp" => (int) timestamp [, "tz" => tz])
// timestamp without tz will result in a UTC DATE-TIME
date = (string) date/datetime string*
tz = (string) <timezone identifier> / offset
// timezone will be used as tzidparam (below), if tzidparam not set
offset = (int) (+/-)HHmm[ss] // (arr/str) local date + UTC offset will result in a UTC DATE-TIME
params2 = (array) ([(datetimeparam/dateparam) / tzidparam] *[,xparams])
datetimeparam = "VALUE" => "DATE-TIME" // default, output as date-time
dateparam = "VALUE" => "DATE" // output as DATE
tzidparam = "TZID" => (string) <timezone identifier>
xparams = (string) key => (string) value // key prefix "X-"
propOrderNo = (int) order number // 1=1st, 2=2nd etc
date/datetime string* recommended formats
"20110625", "2011-06-25", "2011/06/26"
"20110625051015", "20110625 051015"
"20110625T051015", "20110625t051015"
"2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15"
"2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15"
trailing characters (digits), if exists, will be interpreted as offset/timezone
other string formats, acceptable by PHP strtotime function, may (would) work
(notice date restriction)
Example 1
<?php .. . $vevent->setProperty( "exdate", array( array( 2006, 8, 14, 16, 0, 0 )); // exclude 2006-08-14 16.00.00 (local date) from recurrence pattern .. .
Example 2
<?php .. . $vevent->setProperty( "exdate" , array( array("year" =>,2006,"month" => 8,"day"=> 11)) , array( "VALUE" => "DATE" )); // exclude 2006-08-11 from recurrence pattern; .. .
This property defines a rule or repeating pattern for an exception to a recurrence set and is OPTIONAL and MAY occur more than once in VEVENT, VTODO, VJOURNAL components.
EXRULE is deprecated in [RFC5545]!
If set, returns [RFC2445] formatted string, otherwise FALSE.
Format
calendarComponent::createExrule()
Example
<?php .. . $str = $component->createExrule(); .. .
Remove EXRULE from component.
Format
calendarComponent::deleteProperty( "EXRULE" )
Example 1
<?php .. . $vtodo->deleteProperty( "EXRULE" ); .. .
Example 2
Delete EXRULE property no 2.
<?php .. . $vjournal->deleteProperty( "EXRULE", 2 ); .. .
Example 3
Deleting all EXRULE properties.
<?php .. . while( $vjournal->deleteProperty( "EXRULE" )) continue; .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "EXRULE" )
output = recur1
Format 2
calendarComponent::getProperty( "exrule", propOrderNo/FALSE, TRUE )
propOrderNo = (int) specific property value
output = array( "value" => recur1 , "params" => xparams2 )
Format 3
calendarComponent::getProperty( "EXRULE", propOrderNo )
propOrderNo = (int) specific property value
Get propOrderNo EXRULE
Example
<?php .. . $exrule = $vtodo->getProperty( "exrule" ); .. .
Insert property value. Notice, use function transformDateTimeto change a local datetime to a UTC datetime.
Parameters, will be ordered as prescribed in [RFC5545].
Format
calendarComponent::setProperty( "exrule", recur [, xparams [, propOrderNo ]] )
See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar).recur1 = (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 "=>" (string) text ] )
freq = "SECONDLY" /
"MINUTELY" /
"HOURLY" /
"DAILY" /
"WEEKLY" /
"MONTHLY" /
"YEARLY"
enddate = date // a DATE value or a UTC DATE-TIME value
date = (array) ( "year" => (int) year
, "month" => (int) month
, "day" => (int) day
[, "hour" => (int) hour
, "min" => (int) min
, "sec" => (int) sec ])
date = (array) ( "timestamp" => (int) timestamp ) // results in a UTC DATE-TIME
date = (string) date/datetime string*
byseclist = seconds
byseclist = (array) (seconds *(, seconds ))
seconds = 1DIGIT / 2DIGIT ;0 to 59
byminlist = minutes
byminlist = (array) ( minutes *(, minutes ))
minutes = 1DIGIT / 2DIGIT ;0 to 59
byhrlist = hour
byhrlist = (array) ( hour *(, hour ))
hour = 1DIGIT / 2DIGIT ;0 to 23
bywdaylist = weekdaynum
bywdaylist = (array) ( weekdaynum *("," weekdaynum ))
weekdaynum = (array) ( [([plus] ordwk / minus ordwk)], "DAY" => 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 = (array) ( monthdaynum *(, monthdaynum ))
monthdaynum = ( [plus] ordmoday ) / ( minus ordmoday )
ordmoday = 1DIGIT / 2DIGIT ;1 to 31
byyrdaylist = yeardaynum
byyrdaylist = (array) ( yeardaynum *(, yeardaynum ))
yeardaynum = ( [plus] ordyrday ) / ( minus ordyrday )
ordyrday = 1DIGIT / 2DIGIT / 3DIGIT ;1 to 366
bywknolist = weeknum
bywknolist = (array) ( weeknum *(, weeknum ))
weeknum = ( [plus] ordwk ) / ( minus ordwk )
bymolist = monthnum
bymolist = (array) ( monthnum *(, monthnum ))
monthnum = 1DIGIT / 2DIGIT ;1 to 12
bysplist = setposday
bysplist = (array) ( setposday *(, setposday ))
setposday = yeardaynum
xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"
propOrderNo = (int) order number // 1=1st, 2=2nd etc
date/datetime string* recommended formats
"20110625", "2011-06-25", "2011/06/26"
"20110625051015", "20110625 051015"
"20110625T051015", "20110625t051015"
"2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15"
"2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15"
other string formats, acceptable by PHP strtotime function, may (would) work
(notice date restriction)
Example
<?php .. . $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 ) // (*) , "BYHOUR" => array( 2, 4, -6 ) // (*) , "BYMONTHDAY" => -2 // (*) , "BYYEARDAY" => 2 // (*) , "BYWEEKNO" => array( 2, -4, 6 ) // (*) , "BYMONTH" => 2 // (*) , "BYSETPOS" => array( 2, -4, 6 ) // (*) , "BYday" => array( array(-2, "DAY" => "WE" ) , array( 3, "DAY" => "TH") , array( 5, "DAY" => "FR") , array( "DAY" => "MO")) // (**) , "X-NAME" => "x-value" ) , array( "key" => "xparamValue" )); $vtodo->setProperty( >"exrule" , array( "FREQ" => "WEEKLY" , "COUNT" => 2 , "INTERVAL" => 2 , "WKST" => "SU" , "BYSECOND" => array( -2, 4, 6 ) // (*) , "BYMINUTE" => -2 // (*) , "BYHOUR" => 2 // (*) , "BYMONTHDAY" => array( 2, -4, 6 ) // (*) , "BYYEARDAY" => array( -2, 4, 6 ) // (*) , "BYWEEKNO" => -2 // (*) , "BYMONTH" => array( 2, 4, -6 ) // (*) , "BYSETPOS" => -2 // (*) , "BYday" => array( 5, "DAY" => "WE" ) // (**) , "X-NAME" => "x-value" ) , array( "key" => "xparamValue" )); // (*) single value/array of values // (**) single value array /array of arrays .. .
The property defines one or more free or busy time intervals in a VFREEBUSY calendar component.
The value type for FREEBUSY is PERIOD. A PERIOD is a UTC DATE-TIME/DATE-TIME or a UTC DATE-TIME/duration.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createFreebusy()
Example
<?php .. . $str = $component->createfreebusy(); .. .
Remove FREEBUSY from component.
Format
calendarComponent::deleteProperty( "FREEBUSY" )
Example 1
Delete (single/first) FREEBUSY property
<?php .. . $vfreebusy->deleteProperty( "FREEBUSY" ); .. .
Example 2
Delete FREEBUSY property no 2.
<?php .. . $vfreebusy->deleteProperty( "FREEBUSY", 2 ); .. .
Example 3
Deleting all FREEBUSY properties.
<?php .. . while( $vfreebusy->deleteProperty( "FREEBUSY" )) continue; .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "FREEBUSY" )
output = array( "fbtyp" => freebusytype1 , periods2 )
Format 3
calendarComponent::getProperty( "FREEBUSY", propOrderNo/FALSE , TRUE )
propOrderNo = (int) specific property value
output = array( "value" => array("fbtype" => freebusytype1 ,periods2) , "params" => xparams3 )
Format 3
calendarComponent::getProperty( "FREEBUSY", propOrderNo )
propOrderNo = (int) specific property value
Get propOrderNo FREEBUSY
Example
<?php .. . $freebusy = $vfreebusy->getProperty( "FREEBUSY" ); .. .
Format
calendarComponent::setProperty( "freebusy",freebusytype,fbperiods [,xparams [,propOrderNo ]] )
freebusytype1 = one of "FREE"
/ "BUSY" Default
/ "BUSY-UNAVAILABLE"
/ "BUSY-TENTATIVE"
/ x-name
fbperiods = (array) ( periods2 )
periods2 = (array) ( startdate, enddate/duration ) /
(array) ( *[, (array) ( startdate, enddate/duration )] )
startdate/enddate = (array) ( (int) year
, (int) month
, (int) day
, (int) hour
, (int) min
, (int) sec )
startdate/enddate = (array) ( "year" => (int) year
, "month" => (int) month
, "day" => (int) day
, "hour" => (int) hour
, "min" => (int) min
, "sec" => (int) sec ) // output format
startdate/enddate = (array) ( "timestamp" => (int) timestamp ) // results in a UTC DATE-TIME
startdate/enddate = (string) datetime string*
// startdate/enddate MUST be an UTC DATE-TIME
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) ( "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"
xparams3 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"
propOrderNo = (int) order number // 1=1st, 2=2nd etc
date/datetime string* recommended formats
"20110625051015", "20110625 051015"
"20110625T051015", "20110625t051015"
"2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15"
"2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15"
other string formats, acceptable by PHP strtotime function, may (would) work
(notice date restriction)
Example
See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar).<?php .. . $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 ))); .. .
This property specifies information related to the global position for the activity specified by VEVENT and VTODO components and is OPTIONAL and MUST NOT occur more than once.
Value type for latitude and longitude is FLOAT.
Values for latitude and longitude shall be expressed as decimal fractions of degrees. Whole degrees of latitude shall be represented by a two-digit decimal number ranging from 0 through 90. Whole degrees of longitude shall be represented by a decimal number ranging from 0 through 180. When a decimal fraction of a degree is specified, it shall be separated from the whole number of degrees by a decimal point.
The output (float) latitude and longitude values are presented up to six decimals.
Using the non-standard directive "GEOLOCATION" when calling iCalcreator
calendar or component
getProperty method, iCalcreator returns output supporting
ISO6709 "Standard representation of geographic point location by coordinates"
by combining the LOCATION and GEO property values
(only if GEO is set).
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createGeo()
Example
<?php .. . $str = $component->createGeo(); .. .
Remove GEO from component.
Format
calendarComponent::deleteProperty( "GEO" )
Example
<?php .. . $vevent->deleteProperty( "GEO" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "GEO" )
output = array( "latitude" => <latitude> , "longitude" => <longitude>))
Format 2
calendarComponent::getProperty( "GEO", FALSE , TRUE )
output = array( "value" => array ( "latitude" => <latitude> , "longitude" => <longitude>)) , "params" => xparams1 )
Example
<?php .. . $geo = $vevent->getProperty( "GEO" ); .. .
Insert property value.
Format
calendarComponent::setProperty( "geo", latitude, longitude [, xparams ] )
latitude = (float) latitude longitude = (float) longitude xparams1 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"
Example
<?php .. . $vevent->setProperty( "geo", 11.23456, -23.45678 ); .. .
The property specifies the date and time that the information associated with the calendar component was last revised in the calendar store. The property is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO, VJOURNAL and VTIMEZONE components.
The value type for LAST-MODIFIED is UTC DATE-TIME.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createLastModified()
Example
<?php .. . $str = $component->createLastModified(); .. .
Remove LAST-MODIFIED from component.
Format
calendarComponent::deleteProperty( "LAST-MODIFIED" )
Example
<?php .. . $vevent->deleteProperty( "LAST-MODIFIED" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "LAST-MODIFIED" )
output = moddate1
Format 2
calendarComponent::getProperty( "LAST-MODIFIED", FALSE , TRUE )
output = array( "value" => moddate1 , "params" => xparams2 )
Example
<?php .. . $lastMod = $vevent->getProperty( "LAST-MODIFIED" ); .. .
Insert property value. Input date is always a UTC DATE-TIME or, if "offset" parameter is used, converted to a UTC DATE-TIME. Notice, use function transformDateTime to change a local datetime to a UTC datetime.
Format
calendarComponent::setProperty( "Last-Modified" [, moddate [, xparams ]] )
moddate1 = (array) ( "year" => (int) year
, "month" => (int) month
, "day" => (int) day
[, "hour" => (int) hour
, "min" => (int) min
, "sec" => (int) sec
, "tz" => offset ]] )
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
[, offset ]] )
moddate = (array) ( "timestamp" => (int) timestamp ) // results in a UTC DATE-TIME
moddate = (string) date/datetime string*
offset = (int) (+/-)HHmm[ss] // (arr/str) local date + UTC offset will result in a UTC DATE-TIME
xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"
date/datetime string* recommended formats
"20110625", "2011-06-25", "2011/06/26"
"20110625051015", "20110625 051015"
"20110625T051015", "20110625t051015"
"2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15"
"2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15"
trailing characters (digits), if exists, will be interpreted as offset/timezone
other string formats, acceptable by PHP strtotime function, may (would) work
(notice date restriction)
Example 1
<?php .. . $config = array( "unique_id" => "kigkonsult.se" ); $vcalendar = new vcalendar( $config ); $vtodo = & $vcalendar->newComponent( "vtodo" ); .. . $vtodo->setProperty("last-modified", 2006, 8, 14, 12, 1, 2 ); // 14 august 2006 12.01.02 UTC .. .
Example 2
<?php .. . $date = array("year" => 2006, "month" => 10, "day" => 10, "hour" => 10, "min" => 0, "sec" => 0, "tz" => "+0200"); // local date + UTC offset will result in a UTC DATE-TIME $vtodo->setProperty( "last-modified", $date ); .. .
Example 3
<?php .. . $vevent->setProperty( "last-modified" ); // current UTC DATE-TIME is set if called without parameters .. .
The property defines the intended venue for the activity defined by a calendar component. The property is OPTIONAL and MUST NOT occur more than once in VEVENT and VTODO components.
The value type for LOCATION is TEXT.
Using the non-standard directive "GEOLOCATION" when calling iCalcreator
calendar or component
getProperty method, iCalcreator returns output supporting
ISO6709 "Standard representation of geographic point location by coordinates",
by combining the LOCATION and GEO property values
(only if GEO is set).
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createLocation()
Example
<?php .. . $str = $component->createLocation(); .. .
Remove LOCATION from component.
Format
calendarComponent::deleteProperty( "LOCATION" )
Example
<?php .. . $vevent->deleteProperty( "LOCATION" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "LOCATION" )
output = location1
Format 2
calendarComponent::getProperty( "LOCATION", FALSE , TRUE )
output = array( "value" => location1 , "params" => param2 )
Example
<?php .. . $location = $vevent->getProperty( "LOCATION" ); .. .
Insert property value.
Parameters, if any, will be ordered as prescribed in [RFC5545].
Format
calendarComponent::setProperty( "location", location [, param] )
location1 = (string) Value type TEXT params2 = (array) ( ["ALTREP" => (string) "<an alternate text representation, URI>"] [, "LANGUAGE" => (string) "lang*"] *[, xparams ] xparams = (string) key => (string) value // key prefix "X-" lang* = as defined in [RFC5646]
Example
<?php .. . $vevent->setProperty( "location", "Buckingham Palace" ); .. .
The property defines the organizer for a calendar component and is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO, VJOURNAL and VFREEBUSY components.
This value type for ORGANIZER is URI, a calendar user address.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createOrganizer()
Example
<?php .. . $str = $component->createOrganizer(); .. .
Remove ORGANIZER from component.
Format
calendarComponent::deleteProperty( "ORGANIZER" )
Example
<?php .. . $vevent->deleteProperty( "ORGANIZER" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "ORGANIZER" )
output = organizer1
Format 2
calendarComponent::getProperty( "ORGANIZER", FALSE , TRUE )
output = array( "value" => organizer1 , "params" => params2 )
Example
<?php .. . $organizer = $vevent->getProperty( "ORGANIZER" ); .. .
Insert property value. Property value must be prefixed by protocol (ftp://, http://,mailto:, file://.. . ref. rfc 1738), "mailto:" prefixed if missing. Also DIR parameter must be prefixed by protocol. SENT-BY parameter must use protocol "mailto:", prefixed if missing.
Parameters, if any, will be ordered as prescribed in [RFC5545].
Format
calendarComponent::setProperty( "organizer", organizer [, params] )
organizer1 = (string) a calendar user address (cal-address), a URI as defined by [RFC 1738] or any other IANA registered form for a URI. params2 = (array) ( [ "LANGUAGE" => (string) "lang*" (applies to the CN parameter value) ] [, "CN" => (string) "common name to be associated with the calendar user specified by the property"] [, "DIR" => (string) "reference to a directory entry associated with the calendar user specified by the property" ] [, "SENT-BY" => (string) (cal-address, above) "single calendar user that is acting on behalf of the calendar user specified by the property" ] *[, xparams ] xparams = (string) key => (string) value // key prefix "X-" lang* = as defined in [RFC5646]
Example
<?php .. . $dir = "ldap://domain.com:6666/o=3DDC%20Comp,c=3DUS??(cn=3DJohn%20Doe)"; $vevent->setProperty( "organizer" , "ical@domain.com" , array( "CN" => "John Doe" , "DIR" => $dir , "SENT-BY" => "secretary@domain.com" , "X-Key1" => "X-Value1" , "X-Key2" => "X-Value2" )); .. .
This property is used by an assignee or delegatee of a VTODO to convey the percent completion of a VTODO to the Organizer and is OPTIONAL and MUST NOT occur more than once.
The property value is a positive integer between zero and one hundred. A value of "0" indicates the VTODO has not yet been started. A value of "100" indicates that the VTODO has been completed. Integer values in between indicate the percent partially complete.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createPercentComplete()
Example
<?php .. . $str = $component->createPercentComplete(); .. .
Remove PERCENT-COMPLETE from component.
Format
calendarComponent::deleteProperty( "PERCENT-COMPLETE" )
Example
<?php .. . $vtodo->deleteProperty( "PERCENT-COMPLETE" ) .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "PERCENT-COMPLETE" )
output = percent1
Format 2
calendarComponent::getProperty( "PRIORITY", FALSE , TRUE )
output = array( "value" => percent1 , "params" => xparams2 )
Example
<?php .. . $percent = $vtodo->getProperty( "PERCENT-COMPLETE" ); .. .
Insert property value.
Format
calendarComponent::setProperty( "Percent-Complete", percent [, xparams ] )
percent1 = (int) Value type INTEGER xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"
Example
<?php .. . $vtodo->setProperty( "percent-complete", 90 ); .. .
The property defines the relative priority for a calendar component and is OPTIONAL and MUST NOT occur more than once in VEVENT and VTODO components.
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.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createPriority()
Example
<?php .. . $str = $component->createPriority(); .. .
Remove PRIORITY from component.
Format
calendarComponent::deleteProperty( "PRIORITY" )
Example
<?php .. . $vevent->deleteProperty( "PRIORITY" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "PRIORITY" )
output = priority1
Format 2
calendarComponent::getProperty( "PRIORITY", FALSE , TRUE )
output = array( "value" => priority1 , "params" => xparams2 )
Example
<?php .. . $priority = $vevent->getProperty( "priority" ); .. .
Insert property value.
Format
calendarComponent::setProperty( "priority", priority [, xparams ] )
priority1 = (int) Value type INTEGER xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"
Example
<?php .. . $vevent->setProperty( "priority", 3 ); .. .
This property defines the list of date/times for a recurrence set and is OPTIONAL and MAY occur more than once in VEVENT, VTODO, VJOURNAL, STANDARD and DAYLIGHT components.
The default value type for RDATE is DATE-TIME, can be set to DATE or PERIOD (params2). In STANDARD and DAYLIGHT components, RDATE MUST be specified as a date-time value type with local time value.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createRdate()
Example
<?php .. . $str = $component->createRdate(); .. .
Remove RDATE from component.
Format
calendarComponent::deleteProperty( "RDATE" )
Example 1
Delete (single/first) RDATE property.
<?php .. . $vtodo->deleteProperty( "RDATE" ); .. .
Example 2
Delete RDATE property no 2.
<?php .. . $vjournal->deleteProperty( "RDATE", 2 );
Example 3
Delete all RDATE properties.
<?php .. . while( $vjournal->deleteProperty( "RDATE" )) continue; .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "RDATE" )
output = dates1
Format 2
calendarComponent::getProperty( "RDATE", propOrderNo/FALSE , TRUE )
propOrderNo = (int) specific property value
output = array( "value" => dates1 , "params" => params2 )
Format 3
calendarComponent::getProperty( "RDATE", propOrderNo )
propOrderNo = (int) specific property value
Get propOrderNo RDATE
Example
<?php .. . $rdates = $vevent->getProperty( "RDATE" ); .. .
Insert property value.
If DATE value type is set in params ("VALUE" = "DATE"), all timezone or offset in dates are ignored.
If no "VALUE" value type is set or if DATE-TIME value type or TZID value is set in params, DATE-TIME (default) value type is set.
If "TZID" is set in params,
all timezone or offset in dates are ignored (note timestamp, below) and DATE-TIME value type is set.
If empty params and offset in 1st date, all remaining (non-timestamp) dates are set to UTC.
If no "TZID" is set in params and timezone in 1st date, all remaining dates are within this timezone and param "TZID" is set.
If none of the above rules are applicable, DATE-TIME and local date is set default.
Notice, use function transformDateTime to convert a datetime from one time zone to another.
Parameters, if any, will be ordered as prescribed in [RFC5545].
Format
calendarComponent::setProperty( "rdate", dates [, params [, propOrderNo ]] )
dates1 = (array) ( date2 *[, date2 ] )
date2 = date / (array) ( startdate, enddate/duration )
startdate = date
enddate = date
date = (array) ( (int) year
, (int) month
, (int) day
[, (int) int hour
, (int) min
, (int) day
, tz ] )
date = (array) ( "year" => (int) year
, "month" => (int) month
, "day" => (int) day
[, "hour" => (int) hour
, "min" => (int) min
, "sec" => (int) sec
[, "tz" => tz ]] )
// output format
date = (array) ( "timestamp" => (int) timestamp [, "tz" => tz ] )
// timestamp without tz will result in a UTC DATE-TIME
date = (string) date/datetime string*
tz = <timezone identifier> / offset
// timezone will be used as tzidparam, if tzidparam not set
offset = (int) (+/-)HHmm[ss] // (arr/str) local date + UTC offset will result in a UTC DATE-TIME
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, only used keys
duration = (array) ( "sec" => (int) sec );
duration = (string) duration like "P15DT5H0M20S"
params2 = ([tzidparam ( / datetimeparam / dateparam / periodparam )] *[, xparams ] )
tzidparam = "TZID" => (string) <timezone identifier>
// output as local DATE-TIME with timezone identifier
// if tzidparam="GMT"/"UTC" then
// output date-time is suffixed by 'Z'
datetimeparam = "VALUE" => "DATE-TIME" // default, output as DATE-TIME
dateparam = "VALUE" => "DATE" // output as DATE
periodparam = "VALUE" => "PERIOD" // output as PERIOD (datetime)
xparams = (string) key => (string) value // key prefix "X-"
propOrderNo = (int) order number // 1=1st, 2=2nd etc
date/datetime string* recommended formats
"20110625", "2011-06-25", "2011/06/26"
"20110625051015", "20110625 051015"
"20110625T051015", "20110625t051015"
"2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15"
"2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15"
trailing characters (digits), if exists, will be interpreted as offset/timezone
other string formats, acceptable by PHP strtotime function, may (would) work
(notice date restriction)
Example
See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar).<?php .. . // $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 ); $rdate8 = array( "year" => 2007, "month" => 7, "day" => 7 ); $rdur6 = array( "week" => 0 , "day" => 0 , "hour" => 5 , "min" => 5 , "sec" => 5 ); $rdur7 = array( 0, 0, 6 ); // duration for 6 hours $rdur8 = array( "week" => 8 ); // duration for 8 weeks $vevent = & $vcalendar->newComponent( "vevent" ); $vevent->setProperty( "rdate", array( $rdate1 )); // one recurrence date, date in 7-params format (DATE-TIME) $vevent->setProperty( "rdate", array( $rdate1, $rdate2 )); // two dates, date 7-params format (DATE-TIME) $vevent->setProperty( "rdate", array( array( $rdate1, $rdate2 ) , array( $rdate3, $rdate4 )) , array( "VALUE" => "PERIOD" )); // Both fromdate and enddate must have 7 params (DATE-TIME) !!! $vevent->setProperty( "rdate", array( array( $rdate2, $rdur6 )) , array( "VALUE" => "PERIOD" )); // one duration (fromdate-duration) $vevent->setProperty( "rdate", array( array( $rdate1, $date2 ) , array( $rdate3, $rdur7 )) , array( "VALUE" => "PERIOD" )); // period, pairs of fromdate+enddate and fromdate-duration $vevent->setProperty( "rdate", array( $rdate5, $date8 )) , array( "VALUE" => "DATE" )); // dates in DATE format .. .
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 and is OPTIONAL and MAY NOT occur more than once.
The property value is the effective value of the DTSTART property of the recurrence instance. The default value type is DATE-TIME, can be set to DATE (params2).
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createRecurrenceid()
Example
<?php .. . $str = $component->createRecurrenceid(); .. .
Remove RECURRENCE-ID from component.
Format
calendarComponent::deleteProperty( "RECURRENCE-ID" )
Example
<?php .. . $vevent->deleteProperty( "RECURRENCE-ID" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "RECURRENCE-ID" )
output = recurrIdDate1
Format 2
calendarComponent::getProperty( "RECURRENCE-ID", FALSE , TRUE )
output = array( "value" => recurrIdDate1 , "params" => params2 )
Example
<?php .. . $recurrDate = $vtodo->getProperty( "RECURRENCE-ID" ); .. .
Insert property value. If DATE value type is expected, "VALUE" = "DATE" must be set (in params2) otherwise DATE-TIME (default) value type is set.
If no timezone parameter (tz or tzidparam below) is set (local time) and config TZID is set, date-time values will be set WITH timezone from config. Notice, use function transformDateTime to change a datetime from one time zone to another (or UTC).
Format
calendarComponent::setProperty( "recurrence-id", recurrIdDate [, params ] )
recurrIdDate1 = (array) ( "year" => (int) year
, "month" => (int) month
, "day" => (int) day
[, "hour" => (int) hour
, "min" => (int) min
, "sec" => (int) sec
[, "tz" => tz ]] )
recurrIdDate = (int) year
, (int) month
, (int) day
[, (int) hour
, (int) min
, (int) sec
[, tz ]]
recurrIdDate = (array) ( (int) year
, (int) month
, (int) day
[, (int) hour
, (int) min
, (int) sec
[, tz ]] )
recurrIdDate = (array) ( "timestamp" => (int) timestamp [, "tz" => tz ] )
// timestamp without tz will result in a UTC DATE-TIME
recurrIdDate = (string) date/datetime string*
tz = (string) <timezone identifier> / offset
// timezone will be used as tzidparam, if tzidparam not set
offset = (int) (+/-)HHmm[ss] // (arr/str) local date + UTC offset will result in a UTC DATE-TIME
params2 = (array) ([ datetimeparam/dateparam/tzidparam ] [, rangeparam ] *[, xparams ] )
datetimeparam = "VALUE" => "DATE-TIME" // default, output as DATE-TIME
dateparam = "VALUE" => "DATE" // output as DATE
tzidparam = "TZID" => (string) <timezone identifier>
// output as local date-time with timezone identifier
// if tzidparam="GMT"/"UTC" then
// output date-time is suffixed by 'Z'
rangeparam = "RANGE" => ( "THISANDPRIOR"* / "THISANDFUTURE" )
// * deprecated in [RFC5545]!
xparams = string) key => (string) value // key prefix "X-"
date/datetime string* recommended formats
"20110625", "2011-06-25", "2011/06/26"
"20110625051015", "20110625 051015"
"20110625T051015", "20110625t051015"
"2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15"
"2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15"
trailing characters (digits), if exists, will be interpreted as offset/timezone
other string formats, acceptable by PHP strtotime function, may (would) work
(notice date restriction)
Example
<?php .. . $vtodo->setProperty( "recurrence-id", "3 March 2003 03.03.03" ); // 3 march 2003 03.03.03 local time .. .
Example 2
<?php .. . $calendar->setConfig( 'TZID', 'Europe/Stockholm' ); .. . $vtodo->setProperty( "recurrence-id", "3 March 2003 03.03.03" ); // output: RECURRENCE-ID;TZID=Europe/Stockholm:20030303T030303 .. .
The property is used to represent a relationship or reference between one calendar component and another and is OPTIONAL and MAY occur more than once in VEVENT, VTODO, VJOURNAL components.
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.
The value type for RELATED-TO is TEXT.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createRelatedTo()
Example
<?php .. . $str = $component->createRelatedTo(); .. .
Remove RELATED-TO from component.
Format
calendarComponent::deleteProperty( "RELATED-TO" )
Example 1
Delete /single/first) RELATED-TO property
<?php .. . $vtodo->deleteProperty( "RELATED-TO" )
Example 2
Delete RELATED-TO property no 2.
<?php .. . $vjournal->deleteProperty( "RELATED-TO", 2 ); .. .
Example 3
Deleting all RELATED-TO properties.
<?php .. . while( $vjournal->deleteProperty( "RELATED-TO" )) continue; .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "RELATED-TO" )
output = relid1
Format 2
calendarComponent::getProperty( "RELATED-TO", propOrderNo/FALSE , TRUE )
propOrderNo = (int) specific property value
output = array( "value" => relid1 , "params" => params2 )
Format 3
calendarComponent::getProperty( "RELATED-TO", propOrderNo )
propOrderNo = (int) specific property value
Get propOrderNo RELATED-TO
Example
<?php .. . $relatedId = $vtodo->getProperty( "RELATED-TO" ); .. .
Insert property value.
Format
calendarComponent::setProperty( "Related-To", relid [, params [, propOrderNo ]] )
relid1 = (string) Value type TEXT. params2 = (array) ( [ reltype ] *[, xparams] ) reltype = "RELTYPE" => ("PARENT" (Default) / "CHILD" / "SIBLING" / (string) iana-token / (string) x-name ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc
Example
<?php .. . $vtodo->setProperty( "related-to", "19960401-080045-4000F192713@host.com"); .. .
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.
The value type for REPEAT is INTEGER.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createRepeat()
Example
<?php .. . $str = $component->createRepeat(); .. .
Remove REPEAT from component.
Format
calendarComponent::deleteProperty( "REPEAT" )
Example
<?php .. . $valarm->deleteProperty( "REPEAT" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "REPEAT" )
output = repeatTimes1
Format 2
calendarComponent::getProperty( "REPEAT", FALSE , TRUE )
output = array( "value" => repeatTimes1 , "params" => xparams2 )
Example
<?php .. . $repeat = $vtodo->getProperty( "REPEAT" ); .. .
Insert property value.
Format
calendarComponent::setProperty( "repeat", repeatTimes [, xparams ] )
repeatTimes1 = (int) Value type INTEGER xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"
Example
<?php .. . $valarm->setProperty( "repeat", 2 ); .. .
This property defines the status code returned for a scheduling request and is OPTIONAL and MAY occur more than once in VEVENT, VTODO, VJOURNAL and VFREEBUSY components.
The value type for REQUEST-STATUS is TEXT and consists of
In output, the components are separated by (BACKSLASHed) SEMICOLON.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createRequestStatus()
Example
<?php .. . $str = $component->createRequestStatus(); .. .
Remove REQUEST-STATUS from component.
Format
calendarComponent::deleteProperty( "REQUEST-STATUS" )
Example 1
Delete (single/first) REQUEST-STATUS property.
<?php .. . $vtodo->deleteProperty( "REQUEST-STATUS" ); .. .
Example 2
Delete REQUEST-STATUS property no 2.
<?php .. . $vjournal->deleteProperty( "REQUEST-STATUS", 2 ); .. .
Example 3
Deleting all REQUEST-STATUS properties.
<?php .. . while( $vjournal->deleteProperty( "REQUEST-STATUS" )) continue; .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "REQUEST-STATUS" )
output = array( "statcode" => statcode1 , "text" => errtext2 [ , "extdata" => extraData3 ] )
Format 2
calendarComponent::getProperty( "REQUEST-STATUS", propOrderNo/FALSE, TRUE )
propOrderNo = (int) specific property value
output = array( "value" => array( "statcode" => statcode1 , "text" => errtext2 [ , "extdata" => extraData3 ] ) , "params" => params4 )
Format 3
calendarComponent::getProperty( "REQUEST-STATUS", propOrderNo )
propOrderNo = (int) specific property value
Get propOrderNo REQUEST-STATUS
Example
<?php .. . $requestStatus = $vtodo->getProperty( "REQUEST-STATUS" ); .. .
Insert property value.
Format
calendarComponent::setProperty( "Request-Status" , statcode, errtext [,extraData/FALSE [,params [,propOrderNo]]])
statcode1 = (int) Hierarchical, numeric return status code (1*DIGIT "." 1*DIGIT 1*DIGIT) errtext2 = (string) Textual status description extraData3 = (string) Textual exception data. For example, the offending property name and value or complete property line. params4 = (array) ( ["LANGUAGE" => (string) "lang*"] *[, xparams ] ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5646]
Example
<?php .. . $vfreebusy->setProperty("request-status" , 2.00 , "Invalid property value" , "DTSTART:96-Apr-31"); .. .
This property defines the equipment or resources anticipated for an activity specified by a calendar entity and is OPTIONAL and MAY occur more than once in VEVENT and VTODO components.
The value type for RESOURCES is TEXT.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createResources()
Example
<?php .. . $str = $component->createResources(); .. .
Remove RESOURCES from component.
Format
calendarComponent::deleteProperty( "RESOURCES" )
Example 1
Delete (single/first) RESOURCES property.
<?php .. . $vevent->deleteProperty( "RESOURCES" ); .. .
Example 2
Delete RESOURCES property no 2.
<?php .. . $vevent->deleteProperty( "RESOURCES", 2 ); .. .
Example 3
Delete all RESOURCES properties.
<?php .. . while( $vevent->deleteProperty( "RESOURCES" )) continue; .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "RESOURCES" )
output = resources1
Format 2
calendarComponent::getProperty( "RESOURCES", propOrderNo/FALSE, TRUE )
propOrderNo = (int) specific property value
output = array( "value" => resources1 , "params" => params2 )
Format 3
calendarComponent::getProperty( "RESOURCES", propOrderNo )
propOrderNo = (int) specific property value
Get propOrderNo RESOURCES
Example
<?php .. . $resources = $vtodo->getProperty( "RESOURCES" ); .. .
Insert property value.
Parameters, if any, will be ordered as prescribed in [RFC5545].
Format
calendarComponent::setProperty( "resources", resources [, params [, propOrderNo ]] )
resources1 = (string) resource / (array) ( *resource ) resource = (string) textual resources or subtypes of the calendar component, can be specified as a list of resources separated by the COMMA character. params2 = (array) ( [ "ALTREP" => (string) "<an alternate text representation, URI>"] [, "LANGUAGE" => (string) "lang*"] *[, xparams] ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5646]
Example
<?php .. . $vevent->setProperty( "resources", "COMPUTER PROJECTOR" ); .. .
This property defines a rule or repeating pattern for recurring EVENTs, TODOs, STANDARD or DAYLIGHT definitions and is OPTIONAL and MAY occur more than once ([RFC2445]), SHOULD NOT occur more than once ([RFC5545]).
If set, returns iCal formatted string, otherwise FALSE.
Format
calendarComponent::createRrule()
Example
<?php .. . $str = $component->createRrule(); .. .
Remove RRULE from component.
Format
calendarComponent::deleteProperty( "RRULE" )
Example 1
Delete (single/first) RRULE property.
<?php .. . $vevent->deleteProperty( "RRULE" ); .. .
Example 2
Delete RRULE property no 2.
<?php .. . $vevent->deleteProperty( "RRULE", 2 ); .. .
Example 3
Delete all RRULE properties.
<?php .. . while( $vevent->deleteProperty( "RRULE" )) continue; .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "RRULE" )
output = recur1
Format 2
calendarComponent::getProperty( "RRULE", propOrderNo/FALSE, TRUE )
propOrderNo = (int) specific property value
output = array( "value" => recur1 , "params" => xparams2 )
Format 3
calendarComponent::getProperty( "RRULE", propOrderNo )
propOrderNo = (int) specific property value
Get propOrderNo RRULE
Example
<?php .. . $rrules = $vtodo->getProperty( "RRULE" ); .. .
Insert property value.
Parameters will be ordered as prescribed in [RFC5545].
Format
calendarComponent::setProperty( "rrule", recur [, xparams [, propOrderNo ]] )
For rules example see Exrule format and in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar).
recur1 = see Exrule xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc
This property defines the revision sequence number of the calendar component within a sequence of revisions. The property is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO and VJOURNAL components.
It is monotonically incremented by the ORGANIZER's CUA (Calendar
User Agent) 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.
The value type of SEQUENCE is INTEGER.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createSequence()
Example
<?php .. . $str = $component->createSequence(); .. .
Remove SEQUENCE from component.
Format
calendarComponent::deleteProperty( "SEQUENCE" )
Example
<?php .. . $vtodo->deleteProperty( "SEQUENCE" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "SEQUENCE" )
output = sequence1
Format 2
calendarComponent::getProperty( "SEQUENCE", FALSE , TRUE )
output = array( "value" => sequence1 , "params" => xparams2 )
Example
<?php .. . $sequence = $vtodo->getProperty( "SEQUENCE" ); .. .
Insert property value.
Format
calendarComponent::setProperty( "sequence" [, sequence [, xparams ]] )
sequence1 = (int) Value type INTEGER xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"
Example 1
<?php .. . $vevent->setProperty( "sequence", 2 ); // set sequence number to 2 .. .
Example 2
<?php .. . $vevent->setProperty( "sequence" ); // force sequence number to be set to 0 // or, if sequence exists, incremented by 1 .. .
This property defines the overall status or confirmation for the calendar component. The property is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO and VJOURNAL components.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createStatus()
Example
<?php .. . $str = $component->createStatus(); .. .
Remove STATUS from component.
Format
calendarComponent::deleteProperty( "STATUS" )
Example
<?php .. . $vtodo->deleteProperty( "STATUS" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "STATUS" )
output = status1
Format 2
calendarComponent::getProperty( "STATUS", FALSE , TRUE )
output = array( "value" => status1 , "params" => xparams2 )
Example
<?php .. . $status = $vtodo->getProperty( "STATUS" ); .. .
Insert property value.
Format
calendarComponent::setProperty( "status", status [, xparams ] )
// Status values for a VEVENT status1 = "TENTATIVE" // Indicates event is tentative / "CONFIRMED" // Indicates event is definite / "CANCELLED" // Indicates event was cancelled // Status values for VTODO status1 = "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 VJOURNAL status1 = "DRAFT" // Indicates journal is draft / "FINAL" // Indicates journal is final / "CANCELLED" // Indicates journal is removed xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"
Example
<?php .. . $vevent->setProperty( "Status", "COMPLETED" ); .. .
This property defines a short ("one line") summary or subject for the calendar component. (In "[RFC5545], Recommended Practices", up to 255 characters) (, analogous to a mail SUBJECT). The property is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO and VJOURNAL components. The property is REQUIRED and MUST occur once in VALARM (EMAIL) calendar component.
The value type for SUMMARY is TEXT.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createSummary()
Example
<?php .. . $str = $component->createSummary(); .. .
Remove SUMMARY from component.
Format
calendarComponent::deleteProperty( "SUMMARY" )
Example
<?php .. . $vevent->deleteProperty( "SUMMARY" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "SUMMARY" )
output = summary1
Format 2
calendarComponent::getProperty( "SUMMARY", FALSE , TRUE )
output = array( "value" => summary1 , "params" => params2 )
Example
<?php .. . $summary = $vtodo->getProperty( "SUMMARY" ); .. .
Insert property value.
Parameters, if any, will be ordered as prescribed in [RFC5545].
Format
calendarComponent::setProperty( "summary", summary [, params ] )
summary1 = (string) Value type TEXT, a short, one line summary about the activity or journal entry. params2 = array( ["ALTREP" => (string) "<an alternate text representation, URI>"] [, "LANGUAGE" => (string) "lang*"] *[, xparams ] ) xparams = (string) key => (string) value // key prefix "X-" lang* = as defined in [RFC5646]
Example
<?php .. . $vevent->setProperty( "summary", "This is a summary" ); .. .
This property defines whether an EVENT is transparent or not to busy time searches and is OPTIONAL and MUST NOT occur more than once.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createTransp()
Example
<?php .. . $str = $component->createTransp(); .. .
Remove TRANSP from component.
Format
calendarComponent::deleteProperty( "TRANSP" )
Example
<?php .. . $vevent->deleteProperty( "TRANSP" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "TRANSP" )
output = transp1
Format 2
calendarComponent::getProperty( "TRANSP", FALSE , TRUE )
output = array( "value" => transp1 , "params" => xparams2 )
Example
<?php .. . $transp = $vtodo->getProperty( "TRANSP" ); .. .
Insert property value.
Format
calendarComponent::setProperty( "transp", transp [, xparams ] )
transp1 = "OPAQUE" / "TRANSPARENT" xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"
Example
<?php .. . $vevent->setProperty( "transp", "TRANSPARENT" ); .. .
This property specifies when an ALARM will trigger and is REQUIRED and MUST NOT occur more than once.
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 an UTC DATE-TIME value.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
valarm::createTrigger()
Example
<?php .. . $str = $component->createTrigger(); .. .
Remove TRIGGER from component.
Format
valarm::deleteProperty( "TRIGGER" )
Example
<?php .. . $valarm->deleteProperty( "TRIGGER" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
valarm::getProperty( "TRIGGER" )
output = duration/date
Format 2
valarm::getProperty( "TRIGGER", FALSE , TRUE )
output = array( "value" => duration1/date3 ) , "params" => params4 )
Example
<?php .. . $trigger = $vtodo->getProperty( "TRIGGER" ); .. .
Insert property value.
Note, use function transformDateTime to change a (local) datetime to UTC time zone.
Format 1
valarm::setProperty( "trigger", duration1 [, params4 ] )
Format 2
valarm::setProperty( "trigger", duration2 [, params4 ] )
Format 3
valqarm::setProperty( "trigger", date3 [, params4 ] )
Format
valarm::setProperty( "trigger", (int) year / FALSE , (int) month / FALSE , (int) day / FALSE [, (int) week / FALSE [, (int) hour / FALSE , (int) min / FALSE , (int) sec / FALSE [, relatedStart [, before [, params4 ]]]]] )
duration1 = (array) ( "week" => (int) week
, "relatedStart" => relatedStart
, "before" => before )
duration1 = (array) ( "day" => (int) day
, "hour" => (int) hour
, "min" => (int) min
, "sec" => (int) sec
, "relatedStart" => relatedStart
, "before" => before )
relatedStart = (bool) TRUE : related start (default),
FALSE : related end
before = (booL) TRUE : before relatedStart (default),
FALSE : after relatedStart
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-day = 1*DIGIT "D"
dur-hour = 1*DIGIT "H" [dur-minute]
dur-minute = 1*DIGIT "M" [dur-second]
dur-second = 1*DIGIT "S"
date3 = (array) ( "year" => (int) year // UTC DATE-TIME
, "month" => (int) month
, "day" => (int) day
[, "hour" => (int) hour
, "min" => (int) min
, "sec" => (int) sec ])
date3 = (array) ( "timestamp" => (int) timestamp ) // UTC DATE-TIME
date3 = (string) datetime string*
params4 = (array) ( [[ reltype [, trigRelparam ]] / datetimeparam ] *[, xparams ] )
reltyp = "RELATED" => "START" (default) / "END"
trigRelparam = "VALUE" => "DURATION"
datetimeparam= "VALUE" => "DATE-TIME"
xparams = (string) key => (string) value // key prefix "X-"
datetime string* recommended formats
"20110625", "2011-06-25", "2011/06/26"
"20110625051015", "20110625 051015"
"20110625T051015", "20110625t051015"
"2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15"
"2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15"
other string formats, acceptable by PHP strtotime function, may (would) work
(notice date restriction)
Example 1
A duration, 1 hour 2 min 3 sec, before start
<?php .. . $valarm->setProperty( "trigger" , FALSE, FALSE, FALSE, FALSE, 1, 2, 3 ); .. .
Example 2
A duration, 1 hour 2 min 3 sec, before start
<?php .. . $valarm->setProperty( "trigger" , array ("hour"=>1,"min"=>2,"sec"=>3 ); .. .
Example 3
A duration, 1 hour 2 min 3 sec, before start
<?php .. . $valarm->setProperty( "trigger" , "PT1H2M3S" ); .. .
Example 4
A duration, 1 week after end.
<?php .. . $valarm->setProperty( "trigger" , FALSE, FALSE, FALSE, 1 , FALSE, FALSE, FALSE, FALSE, FALSE ); .. .
Example 5
A duration, 1 week after end.
<?php .. . $valarm->setProperty( "trigger" , array ( "week" => 1 , "relatedStart" => FALSE , "before" => FALSE )); .. .
Example 6
A duration, 1 week after end.
<?php .. . $valarm->setProperty( "trigger" , "P1W" , array( "related" => "END" )); .. .
Example 7
<?php .. . $valarm->setProperty( "trigger" , array( "year" => 2007 , "month" => 6 , "day" => 5, , "hour" => 2 , "min" => 2 , "sec" => 3 )); .. .
This property specifies the text value that uniquely identifies the VTIMEZONE calendar component and is REQUIRED, but MUST NOT occur more than once.
The value type for TZID is TEXT.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
vtimezone::createTzid()
Example
<?php .. . $str = $component->createTzid(); .. .
Remove TZID from component.
Format
vtimezone::deleteProperty( "TZID" )
Example
<?php .. . $vtimezone->deleteProperty( "TZID" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
vtimezone::getProperty( "TZID" )
output = tzid1
Format 2
vtimezone::getProperty( "TZID", FALSE , TRUE )
output = array( "value" => tzid1 , "params" => xparams2 )
Example
<?php .. . $tzid = $vtimezone->getProperty( "TZID" ); .. .
Insert property value.
Format
vtimezone::setProperty( "tzid", tzid [, xparams ] )
tzid1 = (string) Value type TEXT xparams2 = (array)( *[ (string) key => (string) value ] ) // key prefix "X-"
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se" ); $vcalendar = new vcalendar( $config ); $vtimezone = & $vcalendar->newComponent( "vtimezone" ); $vtimezone->setProperty( "tzid", "US-Eastern" ); .. .
This property specifies the customary designation for a STANDARD or DAYLIGHT description and is OPTIONAL and MAY occur more than once.
The value type for TZNAME is TEXT.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
vtimezone::createTzname()
Example
<?php .. . $str = $component->createTzname(); .. .
Remove TZNAME from component.
Format
vtimezone::deleteProperty( "TZNAME" )
Example 1
Delete (single/first) TZNAME property.
<?php .. . $vtimezonestd->deleteProperty( "TZNAME" ); .. .
Example 2
Delete TZNAME property no 2.
<?php .. . $vtimezonestd->deleteProperty( "TZNAME", 2 ); .. .
Example 3
Deleting all TZNAME properties.
<?php .. . while( $vtimezonestd->deleteProperty( "TZNAME" )) continue; .. .
If set, returns property value, otherwise FALSE.
Format 1
vtimezone::getProperty( "TZNAME" )
output = tzname1
Format 2
vtimezone::getProperty( "TZNAME", propOrderNo/FALSE, TRUE )
propOrderNo = (int) specific property value
output = array( "value" => tzname1 , "params" => params2 )
Format 3
vtimezone::getProperty( "TZNAME", propOrderNo )
propOrderNo = (int) specific property value
Get propOrderNo TZNAME
Example
<?php .. . $tzname = $timezonestandard->getProperty( "TZNAME" ); .. .
Insert property value.
Format
vtimezone::setProperty( "tzname", tzname [, params [, propOrderNo ]] )
tzname1 = (string) Value type TEXT params2 = (array) ( [ "LANGUAGE" => (string) "lang*" ]*[, xparams ] ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5646]
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se" ); $vcalendar = new vcalendar( $config ); $vtimezone = & $vcalendar->newComponent( "vtimezone" ); $vtimezone->setProperty( "Tzid", "US-Eastern" ); $vtimezone->setProperty( "Last-Modified", "19870101" ); $standard = & $vtimezone->newComponent( "standard" ); $standard->setProperty( "tzname", "EST" ); .. .
This property specifies the offset which is in use prior to this TIMEZONE observance. The property is REQUIRED, but MUST NOT occur more than once in STANDARD and DAYLIGHT components.
The value type is UTC-OFFSET, "+" / "-" time-hour (2*DIGIT) time-minute (2*DIGIT) [time-second (2*DIGIT)].
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
vtimezone::createTzoffsetfrom()
Example
<?php .. . $str = $component->createTzoffsetfrom(); .. .
Remove TZOFFSETFROM from component.
Format
vtimezone::deleteProperty( "TZOFFSETFROM" )
Example
<?php .. . $vtimezonestd->deleteProperty( "TZOFFSETFROM" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
vtimezone::getProperty( "TZOFFSETFROM" )
output = tzoffsetfrom1
Format 2
vtimezone::getProperty( "TZOFFSETFROM", FALSE , TRUE )
output = array( "value" => tzoffsetfrom1 , "params" => xparams2 )
Example
<?php .. . $tzoffsetfrom = $timezonestandard->getProperty( "TZOFFSETFROM" ); .. .
Insert property value.
Format
vtimezone::setProperty( "tzoffsetfrom", tzoffsetfrom [, xparams ] )
tzoffsetfrom1 = (int) (+/-)HHmm[ss] // UTC offset xparams2 = (array) ( *[ /string) key => (string) value ] ) // key prefix "X-"
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se" ); $vcalendar = new vcalendar( $config ); $vtimezone = & $vcalendar->newComponent( "vtimezone" ); $vtimezone->setProperty( "Tzid", "US-Eastern" ); $vtimezone->setProperty( "Last-Modified", "19870101" ); $standard = & $vtimezone->newComponent( "standard" ); $standard->setProperty( "tzname", "EST" ); $standard->setProperty( "tzoffsetfrom", "-0500" ); .. .
This property specifies the offset which is in use in this TIMEZONE observance. The property is REQUIRED, but MUST NOT occur more than once in STANDARD and DAYLIGHT components.
The value type is UTC-OFFSET, "+" / "-" time-hour (2*DIGIT) time-minute (2*DIGIT) [time-second (2*DIGIT)].
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
vtimezone::createTzoffsetto()
Example
<?php .. . $str = $component->createTzoffsetto(); .. .
Remove TZOFFSETTO from component.
Format
vtimezone::deleteProperty( "TZOFFSETTO" )
Example
<?php .. . $daylight->deleteProperty( "TZOFFSETTO" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
vtimezone::getProperty( "TZOFFSETTO" )
output = tzoffsetto1
Format 2
vtimezone::getProperty( "TZOFFSETTO", FALSE , TRUE )
output = array( "value" => tzoffsetto1 , "params" => xparams2 )
Example
<?php .. . $tzoffsetto = $timezonestandard->getProperty( "TZOFFSETTO" ); .. .
Insert property value.
Format
vtimezone::setProperty( "tzoffsetto", tzoffsetto [, xparams ] )
tzoffsetto1 = (int) (+/-)HHmm[ss] // UTC offset xparams2 = array( *[ (string) key => (string) value ] ) // key prefix "X-"
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se" ); $vcalendar = new vcalendar( $config ); $vtimezone = & $vcalendar->newComponent( "vtimezone" ); $vtimezone->setProperty( "Tzid", "US-Eastern" ); $vtimezone->setProperty( "Last-Modified", "19870101" ); $standard = & $vtimezone->newComponent( "standard" ); .. . $daylight = & $vtimezone->newComponent( "daylight" ); $daylight->setProperty( "tzoffsetto", "1345" ); .. .
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. The property is OPTIONAL and MUST NOT occur more than once.
The value type is URI.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
vtimezone::createTzurl()
Example
<?php .. . $str = $component->createTzurl(); .. .
Remove TZURL from component.
Format
vtimezone::deleteProperty( "TZURL" )
Example
<?php .. . $vtimezone->deleteProperty( "TZURL" ); .. .
If set, returns property value, otherwise FALSE.
.Format 1
vtimezone::getProperty( "TZURL" )
output = tzurl1
Format 2
vtimezone::getProperty( "TZURL", FALSE , TRUE )
output = array( "value" => tzurl1 , "params" => xparams2 )
Example
<?php .. . $tzurl = $timezonestandard->getProperty( "TZURL" ); .. .
Insert property value.
Format
vtimezone::setProperty( "tzurl", tzurl [, xparams ] )
tzurl1 = (string) Value type URI xparams2 = array( *[ (string) key => (string) value ] ) // key prefix "X-"
Example
<?php .. . $tz = "http://zones.stds_r_us.net/tz/US-Eastern" ); $config = array( "unique_id" => "kigkonsult.se" ); $vcalendar = new vcalendar( $config ); $vtimezone = & $vcalendar->newComponent( "vtimezone" ); $vtimezone->setProperty( "Tzid", "US-Eastern" ); $vtimezone->setProperty( "Last-Modified", "19870101T000000" ); $vtimezone->setProperty( "tzurl", $tz ); .. .
The persistent, globally Unique IDentifier for the calendar component.
The property is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO,
VJOURNAL and VFREEBUSY components.
However, UID is AUTOMATICALLY generated in iCalcreator and configuration unique_id
is used when auto-creating component UID.
UID generated format :
date("Ymd\THisT")."-".[microSec][random]."@".unique_id
microSec = microseconds, 4 pos
random = 6 characters aA-zZ, 0-9
Example
"20070803T194810CEST-0123U3PXiX@kigkonsult.se"
UID may be required when importing iCal files into some calendar software (MS etc.), as well as (calendar) properties x-properties "X-WR-CALNAME", "X-WR-CALDESC" and "X-WR-TIMEZONE", METHOD (value PUBLISH etc.) and the (also automatically created) DTSTAMP property.
The value type for UID is TEXT.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createUid()
Example
<?php .. . $str = $component->createUid(); .. .
If UID is remove from a component, UID will automatically be recreated when iCalcreator object output methods like createCalendar, returnCalendar or saveCalendar is executed.
Format
calendarComponent::deleteProperty( "UID" )
Example
<?php .. . $vevent->deleteProperty( "UID" ); .. .
If set, returns property, otherwise FALSE.
Format 1
calendarComponent::getProperty( "UID" )
output = uid1
Format 2
calendarComponent::getProperty( "UID", FALSE , TRUE )
output = array( "value" => uid1 , "params" => xparams2 )
Example
<?php .. . $uid = $vevent->getProperty( "UID" ); .. .
Insert property value, overrides any previously set or auto-created UID.
Do NOT use an integer UID or only a component name in UID (ex. "vevent"), this may cause malfunction in iCalcreator object method setComponent with index or UID argument.
Format
calendarComponent::setProperty( "uid", uid [, xparams ] )
uid1 = (string) Value type TEXT xparams2 = array( *[ (string) key => (string) value ] ) // key prefix "X-"
Example
<?php .. . $vevent->setProperty("uid","20070803T194810CEST-0123U3PXiX@kigkonsult.se"); .. .
This property defines a Uniform Resource Locator (URL) associated with the iCalendar object. The property is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO, VJOURNAL and VFREEBUSY components.
The value type is URI.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createUrl()
Example
<?php .. . $str = $component->createUrl(); .. .
Remove URL from component.
Format
calendarComponent::deleteProperty( "URL" )
Example
<?php .. . $vevent->deleteProperty( "URL" ); .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "URL" )
output = url1
Format 2
calendarComponent::getProperty( "URL", FALSE , TRUE )
output = array "value" => url1 , "params" => xparams2 )
Example
<?php .. . $url = $vevent->getProperty( "URL" ); .. .
Insert property value.
Format
calendarComponent::setProperty( "url", url [, xparams ] )
url1 = (string) Value type URI xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"
Example
<?php .. . $vtodo->setProperty( "url", "http://www.icaldomain.net" ); .. .
A component, non-standard property with a TEXT value and a name with an "X-" prefix. In a component, an x-property, with an unique name, can occur only once but the number of x-properties are unlimited.
The value type is TEXT.
If set, returns [RFC5545] formatted string, otherwise FALSE.
Format
calendarComponent::createXprop()
Example
<?php .. . $str = $component->createxProp(); .. .
Remove X-PROPERTY from component.
Format
calendarComponent::deleteProperty( "<X-PROPERTY>" )
Example 1
Deleting x-property named "X-PROPERTY".
<?php .. . $vevent->deleteProperty( "X-PROPERTY" ); .. .
Example 2
Deleting all x-properties.
<?php .. . while( $vevent->deleteProperty()) continue; .. .
If set, returns property value, otherwise FALSE.
Format 1
calendarComponent::getProperty( "<X-PROPERTY>" )
output = array( propertyName1 , propertyData2 )
Format 2
calendarComponent::getProperty()
output = array( propertyName1 , propertyData2 )
Format 3
calendarComponent::getProperty( FALSE, propOrderNo/FALSE, TRUE )
propOrderNo = (int) specific property value
output = array( propertyName1 , array ( "value" => propertyData2 ) , "params" => params3))
Format 4
calendarComponent::getProperty( FALSE, propOrderNo )
propOrderNo = (int) specific property value
Get propOrderNo X-property
Example 1
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename", "file.ics" ); ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); if( FALSE !== ( $d = $vcalendar->getProperty( "X-WR-TIMEZONE" ))) echo $d[1]; // $d = array( "X-WR-TIMEZONE", propertyData2 ) .. .
Example 2
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename", "file.ics" ); ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); while( $xprop = $vcalendar->getProperty( )) {// $xprop = array( propertyName1, propertyData2 ) .. .
Example 3
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename", "file.ics" ); ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); while( $xprop = $vcalendar->getProperty( "X-ABC-MMSUBJ" )) { .. . // $xprop = array( "X-ABC-MMSUBJ", propertyData2 ) .. .
Example 4
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename", "file.ics" ); ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); while( $xprop = $vcalendar->getProperty( FALSE, FALSE, TRUE )) { /* $xprop = array( propertyName1 , array( "value" => propertyData2 ) , "params" => params3 ) */ .. .
Insert property name and value. If an x-prop with the same name already exists, it will be replaced.
Format
calendarComponent::setProperty( propertyName, propertyData [, params ] )
propertyName1 = (string) Any property name with a "X-" prefix propertyData2 = (string) Value type TEXT params3 = (array) ( ["LANGUAGE" => (string) "lang*"] *[, xparams] ) xparams = (string) key => (string) value // key prefix "X-" lang* = as defined in [RFC5646]
Example
<?php .. . $component->setProperty("X-ABC-MMSUBJ","http://load.noise.org/mysubj.wav"); .. .
Format
calendarComponent::getConfig( "language" )
Example
<?php .. . $lang = $vevent->getConfig( "language" ); .. .
Format
calendarComponent::setConfig( "language", lang )
lang = (string) language
Example
<?php .. . $vevent->setConfig( "language", "en" ); .. .
Format
calendarComponent::deleteComponent( orderNumber )
orderNumber = (int) component order Number
Remove component with order number (1st=1, 2nd=2.. .).
calendarComponent::deleteComponent( componentType [, componentSuborderNumber])
componentType = (string) component type componentSuborderNumber = (int) component suborder number
Remove component with component type (ex. "vevent") and order 1 alt. suborder number.
calendarComponent::deleteComponent( UID )
Remove component with UID. N.B UID is NOT set for ALARM / timezone components.
Example 1
Delete first subcomponent.
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics" ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $comp1 = $vcalendar->getComponent(); $comp1->deleteComponent( 1 ); .. .
Example 2
Delete all subcomponents.
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics" ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $comp1 = $vcalendar->getComponent(); while( $comp1->deleteComponent( "valarm" ) continue; .. .
Format 1
calendarComponent::getComponent()
Get next component until end-of-components.
Format 2
calendarComponent::getComponent( int orderNumber )
orderNumber = (int) component order number
Get component with order number (1st=1, 2nd=2.. .).
Format 3
calendarComponent::getComponent( string componentType [, int componentSuborderNumber])
componentType = (string) component type componentSuborderNumber = (int) component suborder number
Get (next) component with component type (until end-of-components) alt. component with component type and suborder number (1st=1, 2nd=2..).
Format 4
calendarComponent::getComponent( UID )
Get component with UID. N.B UID is NOT set for ALARM / timezone components.
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "filename" => "file.ics" ); $vcalendar = new vcalendar( $config ); $vcalendar->parse(); $comp1 = $vcalendar->getComponent()); while( $subComp = $comp1->getComponent()) { .. .
Format
calendarComponent::newComponent( componentType )
componentType = (string) component type
Example 1
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); ... $vevent = & $vcalendar->newComponent( "vevent" ); // add some EVENT properties $vevent->setProperty( "dtstart", 2006, 12, 24, 19, 30, 00 ); $vevent->setProperty(.. . ... $valarm = & $vevent->newComponent( "valarm" ); $valarm->setProperty( "trigger", .. . ...
Example 2
<?php .. . $config = array( "unique_id" => "kigkonsult.se" ); $vcalendar = new vcalendar( $config ); ... $vtimezone = & $vcalendar->newComponent( "vtimezone" ); $vtimezone->setProperty(.. . ... $standard = & $vtimezone->newComponent( "standard" ); $standard->setProperty(.. . ... $daylight = & $vtimezone->newComponent( "daylight" ); $daylight->setProperty(.. . ...
Format 1
calendarComponent::setComponent( component ) addSubComponent( component ) // alias
Insert last in component chain.
Format 2
calendarComponent::setComponent( component, int orderNumber )
orderNumber = (int) component order number
Replace component with order number(1st=1, 2nd=2.. .). If orderNumber is not found, component is inserted last in chain.
Format 3
calendarComponent::setComponent( component, componentType [,componentSuborderNumber])
componentType = (string) component type componentSuborderNumber = (int) component suborder number
Replace component with component type and component order number. if orderNumber is not found, component is inserted last in chain.
Example
<?php .. . $config = array( "unique_id" => "kigkonsult.se", "TZID" => "Europe/Stockholm" ); $vcalendar = new vcalendar( $config ); // initiate new CALENDAR .. . $vevent = new vevent(); // add some EVENT properties $vevent->setProperty( "dtstart", 2006, 12, 24, 19, 30, 00 ); $vevent->setProperty(.. . .. . $valarm = new valarm(); $valarm->setProperty( "trigger", .. . .. . $vevent->setComponent( $valarm ); $vcalendar->setComponent( $vevent ); .. .
iCalUtilityFunctions class contains static functions used by iCalcreator, also usable outside the iCalcreator class.
Removes any line-endings that may include spaces or tabs (\t) and convert all line endings (iCal default "\r\n"), takes care of "\r\n", "\r" and "\n" and mixed "\r\n"+"\r", "\r\n"+"\n".
Returns string with controlled and corrected line endings.
Format
iCalUtilityFunctions::convEolChar( str, nl )
str = (string) string to adjust nl = line ending to convert to
The function, applied on a iCalcrator object instance and using a PHP valid timezone (as argument) creates vtimezone, standard and daylight components, based on PHP DateTimeZone class and the time zone transition dates. (PHP 5 >= 5.2.0)
Recommendation is to call the function after editing components (and without (period) from/to arguments, below), it will automatically create timezone components to fit.
If no time zone transition exists within date arguments or within the "DTSTART"s span, then the time zone transition with the highest transistion date before "from" date is used as base. If still missing,a timezone standard component are created, using current date.
Note, only when timezone NOT is UTC. For dates with UTC DATE-TIME, read this!
FALSE is returned if not using a PHP valid timezone.
Format
iCalUtilityFunctions::createTimezone( calendar, timezone [, xprops, [, from [, to ]]] )
calendar = (object) iCalcreator instance timezone = (string) an PHP (DateTimeZone) valid timezone xprops = (array) ( *[ x-propName => value ] ), timezone non-standard properties from = (int) timestamp, period start date to = (int) timestamp, period end date if the "from" and "to" arguments are missing, the calendar getProperty method (with "DTSTART" as argument) is used to get the lowest (modified, minus one month) and highest (modified, plus one year) DTSTART dates.
Example
<?php .. . $tz = "Europe/Stockholm"; $config = array( "unique_id" => "kigkonsult.se", "TZID" => $tz ); $c = new vcalendar( $config ); $c->setProperty( "X-WR-TIMEZONE", $tz ); .. . .. . // insert components or parse an iCal file .. . $xprops = array( "X-LIC-LOCATION" => $tz ); iCalUtilityFunctions::createTimezone( $c, $tz, $xprops ); .. .
Output example (when using iCalcreator object createCalendar or returnCalendar methods):
BEGIN:VTIMEZONE TZID:Europe/Stockholm X-LIC-LOCATION:Europe/Stockholm BEGIN:STANDARD DTSTART:20111030T003000 TZOFFSETFROM:+0200 TZOFFSETTO:+0100 TZNAME:CET END:STANDARD BEGIN:DAYLIGHT DTSTART:20110327T002000 TZOFFSETFROM:+0100 TZOFFSETTO:+0200 TZNAME:CEST END:DAYLIGHT END:VTIMEZONE
Conversion (very simple) of a MS timezone to a PHP5 valid (Date-)timezone,
matching (MS) UTC offset and time zone descriptors, based on PHP DateTimeZone class.
(PHP 5 >= 5.2.0)
If TRUE is returned, the MS timezone argument (below) is converted to a PHP5 time zone, otherwise unaltered.
Format
iCalUtilityFunctions::ms2phpTZ( timezone )
timezone = (string) MS timezone (input), PHP5 timezone (output)
Example
<?php .. . $search = '"(UTC-06:00) Central Time (US & Canada)"'; echo "MS tz:'$search'<br>\n"; if( FALSE !== iCalUtilityFunctions::ms2phpTZ( $search )) echo "PHP tz:'$search'<br>\n"; .. .
Transforms a datetime from a time zone to another. (Requires PHP >= 5.2.0 and PHP DateTimeZone acceptable time zones).
FALSE is returned if not using a "strtotime" acceptable datetime string or unacceptable PHP time zones. If TRUE, the dateTime argument (below) is converted to the new time zone, otherwise unaltered.
A DATE input (<year><month><day>) will be expanded to a DATETIME (<year><month><day>000000) before transform.
Format
iCalUtilityFunctions::transformDateTime( dateTime, timezoneFrom [, timezoneTo [, format ]] )
dateTime = (array) ( "year" => (int) year // input
, "month" => (int) month
, "day" => (int) day
[, "hour" => (int) hour
, "min" => (int) min
, "sec" => (int) sec ] )
dateTime = (array) ( (int) year // input
, (int) month
, (int) day
[, (int) hour
, (int) min
, (int) sec ] )
dateTime = (array) ( "timestamp" => (int) timestamp ) // input
dateTime = (string) datetime string* // input
dateTime = (string) datetime string // on successful output
timezoneFrom = (string) a PHP (DateTimeZone) valid time zone
timezoneTo = (string) a PHP (DateTimeZone) valid time zone, default "UTC"
format = (string) output format (any date formatting, default "Ymd\THis")
datetime string* recommended formats
"20110625", "2011-06-25", "2011/06/26"
"20110625051015", "20110625 051015"
"20110625T051015", "20110625t051015"
"2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15"
"2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15"
other string formats, acceptable by PHP strtotime function, may (would) work
(notice date restriction)
Example
Convert from time zone "Europe/Stockholm" to "UTC"
<?php .. . $d = date( "Y-m-d H:i:s" ); $tzFr = "Europe/Stockholm"; if( FALSE !== iCalUtilityFunctions::transformDateTime( $d, $tzFr )) $event->setProperty( "dtstart", $d."Z" ); else $event->setProperty( "dtstart", $d, array( "TZID" => $tzFr )); .. .
[index] [top] [up]iCalUtilityFunctions static date(-time)/timestamp functions. Please examine the class file for more information about arguments and output.
The helper functions extend the utility of iCalcreator.
The iCal2XML function converts an iCalcreator object instance to XML format according to rfc6321, "xCal: The XML Format for iCalendar".
Requires PHP 5 and "libxml" PHP extension (--enable-libxml) and utilizes the SimpleXML extension. Before PHP 5.1.2, "--enable-simplexml" (at compile time) is required to enable this extension, after PHP 5.1.2 enabled by default.
An rfc6321 XML string is returned.
Format
iCal2XML( iCalobj )
iCalobj = (object) iCalcreator instance
The XML2iCal function, with the two entry functions: XMLstr2iCal and XMLfile2iCal, converts XML (rfc6321, "xCal: The XML Format for iCalendar"), using PHP SimpleXMLElement to an iCalcreator instance.
Requires PHP 5 and "libxml" PHP extension (--enable-libxml) and utilizes the SimpleXML extension. Before PHP 5.1.2, "--enable-simplexml" (at compile time) is required to enable this extension, after PHP 5.1.2 enabled by default.
On success, an iCalcreator instance is returned.
On XML parse error, FALSE is returned and error information (if any) are redirected to PHP error log.
The function accepts a well-formed (rfc6321) XML string as argument.
Format
XMLstr2iCal( xmlstr [, config] )
xmlstr = (string) rfc6321 XML config = (array) iCalcreator config array (opt)
The function accepts an XML (rfc6321) local file or a remote URI, as argument.
Format
XMLfile2iCal( xmlfile [, config] )
xmlfile = (string) rfc6321 XML file name or resource config = (array) iCalcreator config array (opt)
This function is doing the hard work in XMLstr2iCal/XMLfile2iCal functions.
Format
XML2iCal( xmlobj [, config] )
xmlobj = (object) SimpleXML element instance config = (array) iCalcreator config array (opt)
Additional functions to use with vtimezone components.
The getTimezonesAsDateArrays function creates time zone transition information, based on vtimezone components contents in a iCalcreator calendar instance.
The getTzOffsetForDate function returns UTC offset information for specific date (timestamp) based on output from getTimezonesAsDateArrays function.
Before calling the functions getTzOffsetForDate and getTimezonesAsDateArrays, set time zone 'GMT' ('date_default_timezone_set')!
The getTzOffsetForDate function returns UTC offset information for specific date (timezone) based on output from getTimezonesAsDateArrays function.
Before calling the function, set time zone 'GMT' ('date_default_timezone_set')!
Returns array, time zone data for specific date (timestamp) with keys for
Format
getTzOffsetForDate( timezonesarray, tzid, timestamp )
timezonesarray = (array) output from getTimezonesAsDateArrays, below tzid = (string) time zone identifier timestamp = (mixed) the date in question (timestamp) or UTC datetime (array) ( "year" => (int) year , "month" => (int) month , "day" => (int) day , "hour" => (int) hour , "min" => (int) min , "sec" => (int) sec )
The function creates time zone transition information, based on vtimezone component contents in a iCalcreator calendar instance, using sub-function expandTimezoneDates.
Before calling the function, set time zone 'GMT' ('date_default_timezone_set')!
Returns an array containing time zone data from vtimezone standard/daylight instances (input to getTzOffsetForDate, above).
Format
getTimezonesAsDateArrays( iCalobj )
iCalobj= (object) iCalcreator calendar instance
The purpose of the vCard helper functions are to produce simplified vCard output.
Convert single ATTENDEE, CONTACT or ORGANIZER URI (in email format) to simplified vCard output or saved in vCard file.
If argument directory is set, vCards are saved in (directory/) files, named like <firstName>.<familyName>."ext".
Returns vCard string or TRUE if a valid directory is used as argument (and file write ok) otherwise FALSE.
Format
iCal2vCard( email [ ,version [ ,directory [ ,ext ]]] )
email = (string) ATTENDEE, CONTACT or ORGANIZER URI in email format version = (string) vCard version, default "2.1", opt. "3.0"/"4.0" directory = (string) if and where to save vCards files, default FALSE ext = (string) vCard file extension, default "vcf"
Collect and convert all ATTENDEEs, CONTACTs and ORGANIZERs (URI, in email format) to simplified vCard output or saved in vCard files, using iCal2vCard function (above).
The file name formatting and return values are described above in iCal2vCard function.
Format
iCal2vCards( vcalendar [ ,version [ ,directory [ ,ext ]]] )
vcalendar = (object) iCalcreator object instance version = (string) vCard version, default "2.1", opt. "3.0"/"4.0" directory = (string) if and where to save vCards files, default FALSE ext = (string) vCard file extension, default "vcf"
iCalcreator v2.16.6
copyright (c) 2007-2013 Kjell-Inge Gustafsson, kigkonsult
kigkonsult.se iCalcreator
kigkonsult.se contact
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.