From 2608eef8e2006e3b9e23cdea894c3d0a32be0b44 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Wed, 21 Sep 2011 00:50:06 +1200 Subject: [PATCH] Allow to override the format for output. --- inc/RRule-v2.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/inc/RRule-v2.php b/inc/RRule-v2.php index d6a35a45..361b2d81 100644 --- a/inc/RRule-v2.php +++ b/inc/RRule-v2.php @@ -355,7 +355,7 @@ class RepeatRuleDateTime extends DateTime { * * @see RepeatRuleDateTime::FloatOrUTC() */ - public function UTC() { + public function UTC($fmt = 'Ymd\THis\Z' ) { $gmt = clone($this); if ( $this->tzid != 'UTC' ) { if ( isset($this->tzid)) { @@ -367,7 +367,7 @@ class RepeatRuleDateTime extends DateTime { $offset = 0 - $dtz->getOffset($gmt); $gmt->modify( $offset . ' seconds' ); } - return $gmt->format('Ymd\THis\Z'); + return $gmt->format($fmt); } @@ -583,6 +583,11 @@ class RepeatRule { } + /** + * Return the next date in the repeating series. + * @param boolean $return_floating_times Whether to return dates as floating times. + * @return vComponent The next instance. + */ public function next($return_floating_times=false) { $this->position++; return $this->current($return_floating_times);