Overview

Packages

  • awl
    • caldav-client-v2
    • RRule
  • davical
    • authentication
      • drivers
    • caldav
    • DAViCalSession
    • DAVTicket
    • external-bind
    • feed
    • HTTPAuthSession
    • iSchedule
    • iSchedule-POST
    • logging
    • metrics
    • Principal
    • propfind
    • PublicSession
    • Request
    • Resource
    • tzservice
  • None

Classes

  • RepeatRule
  • RepeatRuleDateRange
  • RepeatRuleDateTime
  • RepeatRuleTimeZone
  • Rfc5545Duration

Functions

  • expand_event_instances
  • getComponentRange
  • getVCalendarRange
  • olson_from_vtimezone
  • rdate_expand
  • rrule_expand
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class Rfc5545Duration

Provide a useful way of dealing with RFC5545 duration strings of the form ^-?P(\dW)|((\dD)?(T(\dH)?(\dM)?(\dS)?)?)$

Package: awl\RRule
Copyright: Morphoss Ltd
License: GNU GPL v2 or later
Author: Andrew McMillan andrew@mcmillan.net.nz
Located at RRule.php
Methods summary
public
# __construct( mixed $in_duration )

Construct a new Rfc5545Duration either from incoming seconds or a text string.

Construct a new Rfc5545Duration either from incoming seconds or a text string.

Parameters

$in_duration
public boolean
# equals( Rfc5545Duration $other )

Return true if $this and $other are equal, false otherwise.

Return true if $this and $other are equal, false otherwise.

Parameters

$other

Returns

boolean
public
# asSeconds( )

Returns the duration as epoch seconds.

Returns the duration as epoch seconds.

public string
# __toString( )

Returns the duration as a text string of the form ^(-?)P(\d+W)|((\d+D)?(T(\d+H)?(\d+M)?(\d+S)?)?)$

Returns the duration as a text string of the form ^(-?)P(\d+W)|((\d+D)?(T(\d+H)?(\d+M)?(\d+S)?)?)$

Returns

string
The stringified stuff.
public static Rfc5545Duration
# fromTwoDates( RepeatRuleDateTime $d1, RepeatRuleDateTime $d2 )

Factory method to return an Rfc5545Duration object from the difference between two dates.

Factory method to return an Rfc5545Duration object from the difference between two dates.

This is flawed, at present: we should really localise both dates and work out the difference in days, then localise the times and work out the difference between the clock times. On the other hand we're replacing a quick and dirty hack that did it exactly the same way in the past, so we're not making things any worse and at least we're making it clear that it could be improved...

The problem strikes (as they all do) across DST boundaries.

Parameters

$d1
$d2

Returns

Rfc5545Duration

Todo

Improve this to calculate the days difference and then the clock time diff and work from there.


DAViCal API documentation generated by ApiGen