\ZCRecurringDate

Zap Calendar Recurring Date Helper Class

Class to expand recurring rule to a list of dates

Summary

Methods
Properties
Constants
__construct()
bySetPos()
setError()
getError()
setDebug()
debug()
getDates()
$rules
$startdate
$freq
$tzid
$repeatmode
$until
$count
$bysecond
$byminute
$byhour
$byday
$bymonthday
$bymonth
$byyear
$bysetpos
$interval
$debug
$error
$exdates
No constants found
No protected methods found
No protected properties found
N/A
byYear()
byMonth()
byMonthDay()
byDay()
byHour()
byMinute()
bySecond()
maxDates()
No private properties found
N/A

Properties

$rules

$rules : string

rules string

Type

string

$startdate

$startdate : integer

start date in Unix Timestamp format (local timezone)

Type

integer

$freq

$freq : string

repeating frequency type (i.e. "y" for yearly, "m" for monthly)

Type

string

$tzid

$tzid : string

timezone of event (using PHP timezones)

Type

string

$repeatmode

$repeatmode : string

repeat mode ('c': count, 'u': until)

Type

string

$until

$until : integer

repeat until date (in UTC Unix Timestamp format)

Type

integer

$count

$count : integer

repeat count when repeat mode is 'c'

Type

integer

$bysecond

$bysecond : array

array of repeat by seconds values

Type

array

$byminute

$byminute : array

array of repeat by minutes values

Type

array

$byhour

$byhour : array

array of repeat by hour values

Type

array

$byday

$byday : array

array of repeat by day values

Type

array

$bymonthday

$bymonthday : array

array of repeat by month day values

Type

array

$bymonth

$bymonth : array

array of repeat by month values

Type

array

$byyear

$byyear : array

array of repeat by year values

Type

array

$bysetpos

$bysetpos : array

array of repeat by setpos values

Type

array

$interval

$interval : integer

inteval of repeating event (i.e. every 2 weeks, every 6 months)

Type

integer

$debug

$debug : integer

debug level (for testing only)

Type

integer

$error

$error : string

error string (future use)

Type

string

$exdates

$exdates : array

array of exception dates in Unix Timestamp format (UTC dates)

Type

array

Methods

__construct()

__construct(string  $rules, integer  $startdate, array  $exdates = array(), string  $tzid = "UTC") 

Expand recurring rule to a list of dates

Parameters

string $rules

iCalendar rules string

integer $startdate

start date in Unix Timestamp format

array $exdates

array of exception dates

string $tzid

timezone of event (using PHP timezones)

bySetPos()

bySetPos(array  $bytype, array  $bysetpos) : array

bysetpos rule support

Parameters

array $bytype
array $bysetpos

Returns

array

setError()

setError(string  $msg) 

save error

Parameters

string $msg

getError()

getError() : string

get error message

Returns

string —

error message

setDebug()

setDebug(integer  $level) 

set debug level (0: none, 1: minimal, 2: more output)

Parameters

integer $level

debug()

debug(integer  $level, string  $msg) 

display debug message

Parameters

integer $level
string $msg

getDates()

getDates(  $maxdate = null) : array

Get array of dates from recurring rule

Parameters

$maxdate

integer maximum date to appear in repeating dates in Unix timestamp format

Returns

array

byYear()

byYear(integer  $startdate, integer  $enddate, array  $rdates, string  $tzid = "UTC") : integer

Get repeating dates by year

Parameters

integer $startdate

start date of repeating events, in Unix timestamp format

integer $enddate

end date of repeating events, in Unix timestamp format

array $rdates

array to contain expanded repeating dates

string $tzid

timezone of event (using PHP timezones)

Returns

integer —

count of dates

byMonth()

byMonth(integer  $startdate, integer  $enddate, array  $rdates, string  $tzid = "UTC") : integer

Get repeating dates by month

Parameters

integer $startdate

start date of repeating events, in Unix timestamp format

integer $enddate

end date of repeating events, in Unix timestamp format

array $rdates

array to contain expanded repeating dates

string $tzid

timezone of event (using PHP timezones)

Returns

integer —

count of dates

byMonthDay()

byMonthDay(integer  $startdate, integer  $enddate, array  $rdates, string  $tzid = "UTC") : integer

Get repeating dates by month day

Parameters

integer $startdate

start date of repeating events, in Unix timestamp format

integer $enddate

end date of repeating events, in Unix timestamp format

array $rdates

array to contain expanded repeating dates

string $tzid

timezone of event (using PHP timezones)

Returns

integer —

count of dates

byDay()

byDay(integer  $startdate, integer  $enddate, array  $rdates, string  $tzid = "UTC") : integer

Get repeating dates by day

Parameters

integer $startdate

start date of repeating events, in Unix timestamp format

integer $enddate

end date of repeating events, in Unix timestamp format

array $rdates

array to contain expanded repeating dates

string $tzid

timezone of event (using PHP timezones)

Returns

integer —

count of dates

byHour()

byHour(integer  $startdate, integer  $enddate, array  $rdates, string  $tzid = "UTC") : integer

Get repeating dates by hour

Parameters

integer $startdate

start date of repeating events, in Unix timestamp format

integer $enddate

end date of repeating events, in Unix timestamp format

array $rdates

array to contain expanded repeating dates

string $tzid

timezone of event (using PHP timezones)

Returns

integer —

count of dates

byMinute()

byMinute(integer  $startdate, integer  $enddate, array  $rdates, string  $tzid = "UTC") : integer

Get repeating dates by minute

Parameters

integer $startdate

start date of repeating events, in Unix timestamp format

integer $enddate

end date of repeating events, in Unix timestamp format

array $rdates

array to contain expanded repeating dates

string $tzid

timezone of event (using PHP timezones)

Returns

integer —

count of dates

bySecond()

bySecond(integer  $startdate, integer  $enddate, array  $rdates, string  $tzid = "UTC") : integer

Get repeating dates by second

Parameters

integer $startdate

start date of repeating events, in Unix timestamp format

integer $enddate

end date of repeating events, in Unix timestamp format

array $rdates

array to contain expanded repeating dates

string $tzid

timezone of event (using PHP timezones)

Returns

integer —

count of dates

maxDates()

maxDates(array  $rdates) : boolean

Determine if the loop has reached the end date

Parameters

array $rdates

array of repeating dates

Returns

boolean