From 93a165fb82ab35b2e4edb6a3dc3d3c7602504096 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Fri, 29 Oct 2010 13:37:42 +0200 Subject: [PATCH] set until on unlimited repeats, to be included in Between() --- blocks/SG_iCal_VEvent.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/blocks/SG_iCal_VEvent.php b/blocks/SG_iCal_VEvent.php index c2c8841..f13f9f0 100755 --- a/blocks/SG_iCal_VEvent.php +++ b/blocks/SG_iCal_VEvent.php @@ -63,7 +63,7 @@ class SG_iCal_VEvent { $until = $this->recurrence->getUntil(); $count = $this->recurrence->getCount(); //check if there is either 'until' or 'count' set - if ( $this->recurrence->getUntil() or $this->recurrence->getCount() ) { + if ( $until or $count ) { //if until is set, set that as the end date (using getTimeStamp) if ( $until ) { //date_default_timezone_set( xx ); @@ -71,8 +71,13 @@ class SG_iCal_VEvent { $this->lastend = $this->laststart + $this->getDuration(); } //if count is set, then figure out the last occurrence and set that as the end date + } else { + //forever... limit to 3 years + $this->recurrence->setUntil('+3 years'); + $until = $this->recurrence->getUntil(); + $this->laststart = strtotime($until); + $this->lastend = $this->laststart + $this->getDuration(); } - } $imports = array('summary','description','location');