From e81a439d4fb17281b01c00fb411af91272b7e672 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Fri, 29 Oct 2010 14:04:21 +0200 Subject: [PATCH] nextOccurrence < start check --- SG_iCal.php | 2 +- helpers/SG_iCal_Freq.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SG_iCal.php b/SG_iCal.php index dce65c1..2e5bf3c 100755 --- a/SG_iCal.php +++ b/SG_iCal.php @@ -1,6 +1,6 @@ 'monday', 'TU'=>'tuesday', 'WE'=>'wednesday', 'TH'=>'thursday', 'FR'=>'friday', 'SA'=>'saturday', 'SU'=>'sunday'); - protected $knownRules = array('month', 'weekno', 'day', 'monthday', 'yearday', 'hour', 'minute'); + protected $knownRules = array('month', 'weekno', 'day', 'monthday', 'yearday', 'hour', 'minute'); //others : 'setpos', 'second' + protected $ruleModifiers = array('wkst'); protected $simpleMode = true; protected $rules = array('freq'=>'yearly', 'interval'=>1); @@ -97,7 +98,7 @@ class SG_iCal_Freq { * @return int */ public function nextOccurrence( $offset ) { - //return $this->findNext( $this->previousOccurrence( $offset) ); + $start = ($offset > $this->start) ? $offset : $this->start; return $this->findNext($offset); }