RepeatRule bug fixes during testing.

This commit is contained in:
Andrew McMillan 2010-03-12 18:29:14 +13:00
parent 6b495b6556
commit 4be420e8ec

View File

@ -39,7 +39,7 @@ class RepeatRuleDateTime extends DateTime {
public static $Format = 'c'; public static $Format = 'c';
private $tzid; private $tzid;
public function __construct($date = null, DateTimeZone $dtz = null) { public function __construct($date = null, $dtz = null) {
if (preg_match('/;?TZID=([^:]+):(\d{8}(T\d{6})?)(Z)?/', $date, $matches) ) { if (preg_match('/;?TZID=([^:]+):(\d{8}(T\d{6})?)(Z)?/', $date, $matches) ) {
if ( isset($matches[4]) && $matches[4] == 'Z' ) { if ( isset($matches[4]) && $matches[4] == 'Z' ) {
$dtz = new DateTimeZone('UTC'); $dtz = new DateTimeZone('UTC');
@ -85,7 +85,7 @@ class RepeatRuleDateTime extends DateTime {
public function UTC() { public function UTC() {
$gmt = parent::__clone(); $gmt = clone($this);
if ( isset($this->tzid) && $this->tzid != 'UTC' ) { if ( isset($this->tzid) && $this->tzid != 'UTC' ) {
$dtz = parent::getTimezone(); $dtz = parent::getTimezone();
$offset = $dtz->getOffset($gmt); $offset = $dtz->getOffset($gmt);