Docs For Class Rfc5545Duration

## Rfc5545Duration

Description

Provide a useful way of dealing with RFC5545 duration strings of the form

^-?P(\dW)|((\dD)?(T(\dH)?(\dM)?(\dS)?)?)$

Located in /inc/RRule-v2.php (line 77)

Method Summary
static Rfc5545Duration fromTwoDates (RepeatRuleDateTime $d1, RepeatRuleDateTime $d2)
Rfc5545Duration __construct (mixed $in_duration)
void asSeconds ()
boolean equals (Rfc5545Duration $other)
string __toString ()
Methods
static fromTwoDates (line 192)

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.

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

Rfc5545Duration fromTwoDates (RepeatRuleDateTime $d1, RepeatRuleDateTime $d2)

- RepeatRuleDateTime $d1
- RepeatRuleDateTime $d2

Constructor __construct (line 87)

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

Rfc5545Duration __construct (mixed $in_duration)

- mixed $in_duration

asSeconds (line 116)

Returns the duration as epoch seconds.

void asSeconds ()
equals (line 107)

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

boolean equals (Rfc5545Duration $other)

- Rfc5545Duration $other

__toString (line 145)

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

- return: The stringified stuff.

string __toString ()

Documentation generated on Sun, 08 Jul 2012 12:53:51 +0000 by phpDocumentor 1.4.3