Overview

Packages

  • awl
    • caldav
  • davical
    • authentication
    • caldav
    • DAViCalSession
    • DAVTicket
    • external-bind
    • HTTPAuthSession
    • iSchedule
    • iSchedule-POST
    • ldap
    • logging
    • Principal
    • propfind
    • PublicSession
    • pwauth
    • Request
    • Resource
    • tzservice
  • iSchedule
  • None

Classes

  • CalendarInfo
  • iCalDate
  • RepeatRule
  • RepeatRuleDateRange
  • RepeatRuleDateTime
  • RepeatRuleTimeZone
  • Rfc5545Duration
  • RRule

Functions

  • expand_event_instances
  • getComponentRange
  • getVCalendarRange
  • olson_from_vtimezone
  • rdate_expand
  • rrule_expand
  • Overview
  • Package
  • Class

Class iCalDate

A Class for handling dates in iCalendar format. We do make the simplifying assumption that all date handling in here is normalised to GMT. One day we might provide some functions to do that, but for now it is done externally.

Package: awl\caldav
Copyright: Catalyst .Net Ltd
License: GNU GPL v2
Author: Andrew McMillan andrew@catalyst.net.nz
Located at RRule.php
Methods summary
public
# iCalDate( $input )

The constructor takes either an iCalendar date, a text string formatted as an iCalendar date, or epoch seconds.

The constructor takes either an iCalendar date, a text string formatted as an iCalendar date, or epoch seconds.

public
# SetGMTDate( $input )

Set the date from a text string

Set the date from a text string

public
# SetLocalDate( $input )

Set the date from a text string

Set the date from a text string

public
# SetEpochDate( $input )

Set the date from an epoch

Set the date from an epoch

public
# _TextFromEpoch( )

Given an epoch date, convert it to text

Given an epoch date, convert it to text

public
# _GMTTextFromEpoch( )

Given a GMT epoch date, convert it to text

Given a GMT epoch date, convert it to text

public
# _PartsFromText( )

Given a text date, convert it to parts

Given a text date, convert it to parts

public
# _GMTEpochFromParts( )

Given a GMT text date, convert it to an epoch

Given a GMT text date, convert it to an epoch

public
# _EpochFromParts( )

Given a local text date, convert it to an epoch

Given a local text date, convert it to an epoch

public
# SetWeekStart( string $weekstart )

Set the day of week used for calculation of week starts

Set the day of week used for calculation of week starts

Parameters

$weekstart
The day of the week which is the first business day.
public
# Render( $fmt = 'Y-m-d H:i:s' )

Set the day of week used for calculation of week starts

Set the day of week used for calculation of week starts

public
# RenderGMT( $fmt = 'Ymd\THis\Z' )

Render the date as GMT

Render the date as GMT

public
# DaysInMonth( $mo = false, $yy = false )

No of days in a month 1(Jan) - 12(Dec)

No of days in a month 1(Jan) - 12(Dec)

public
# SetMonthDay( $dd )

Set the day in the month to what we have been given

Set the day in the month to what we have been given

public
# AddMonths( $mo )

Add some number of months to a date

Add some number of months to a date

public
# AddDays( $dd )

Add some integer number of days to a date

Add some integer number of days to a date

public
# AddDuration( $duration )

Add duration

Add duration

public string
# DateDifference( date $from )

Produce an iCalendar format DURATION for the difference between this an another iCalDate

Produce an iCalendar format DURATION for the difference between this an another iCalDate

Parameters

$from
The start of the period

Returns

string
The date difference, as an iCalendar duration format
public boolean
# TestByMonth( string $monthlist )

Test to see if our _mo matches something in the list of months we have received.

Test to see if our _mo matches something in the list of months we have received.

Parameters

$monthlist
A comma-separated list of months.

Returns

boolean
Whether this date falls within one of those months.
public array
# GetMonthByDay( string $byday )

Applies any BYDAY to the month to return a set of days

Applies any BYDAY to the month to return a set of days

Parameters

$byday
The BYDAY rule

Returns

array
An array of the day numbers for the month which meet the rule.
public array
# GetMonthByMonthDay( string $bymonthday )

Applies any BYMONTHDAY to the month to return a set of days

Applies any BYMONTHDAY to the month to return a set of days

Parameters

$bymonthday
The BYMONTHDAY rule

Returns

array
An array of the day numbers for the month which meet the rule.
public array
# GetWeekByDay( string $byday, string $increasing = false )

Applies any BYDAY to the week to return a set of days

Applies any BYDAY to the week to return a set of days

Parameters

$byday
The BYDAY rule
$increasing
When we are moving by months, we want any day of the week, but when by day we only want to increase. Default false.

Returns

array
An array of the day numbers for the week which meet the rule.
public boolean
# GreaterThan( string $lesser )

Test if $this is greater than the date parameter

Test if $this is greater than the date parameter

Parameters

$lesser
The other date, as a local time string

Returns

boolean
True if $this > $lesser
public boolean
# LessThan( string $greater )

Test if $this is less than the date parameter

Test if $this is less than the date parameter

Parameters

$greater
The other date, as a local time string

Returns

boolean
True if $this < $greater
public array &
# MonthDays( string $dow_first, string $days_in_month, string $dayspec )

Given a MonthDays string like "1MO", "-2WE" return an integer day of the month.

Given a MonthDays string like "1MO", "-2WE" return an integer day of the month.

Parameters

$dow_first
The day of week of the first of the month.
$days_in_month
The number of days in the month.
$dayspec
The specification for a month day (or days) which we parse.

Returns

array
An array of the day numbers for the month which meet the rule.
public array &
# ApplyBySetPos( string $bysplist, string $set )

Given set position descriptions like '1', '3', '11', '-3' or '-1' and a set, return the subset matching the list of set positions.

Given set position descriptions like '1', '3', '11', '-3' or '-1' and a set, return the subset matching the list of set positions.

Parameters

$bysplist
The list of set positions.
$set
The set of days that we will apply the positions to.

Returns

array
The subset which matches.
Properties summary
public $_text

Text version

Text version

#
public $_epoch

Epoch version

Epoch version

#
public $_yy

Fragmented parts

Fragmented parts

#
public $_mo
#
public $_dd
#
public $_hh
#
public $_mi
#
public $_ss
#
public $_tz
#
public $_wkst

Which day of the week does the week start on

Which day of the week does the week start on

#
API documentation generated by ApiGen