From e0e757c985b56ad5968bc1ecc8141da7726241fa Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Wed, 24 Dec 2008 08:49:37 +0000 Subject: fix starting date range for freq weekly --- functions/parse/end_vevent.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'functions') diff --git a/functions/parse/end_vevent.php b/functions/parse/end_vevent.php index e9e3064..2ccd3a9 100644 --- a/functions/parse/end_vevent.php +++ b/functions/parse/end_vevent.php @@ -229,7 +229,16 @@ if($count == 1000000){ if ($next_range_unixtime < $start_date_unixtime) $next_range_unixtime = $start_date_unixtime; if(isset($until) && $end_range_unixtime > $until_unixtime) $end_range_unixtime = $until_unixtime; -if($freq_type == 'year') $end_range_unixtime += 366*24*60*60; + +switch ($freq_type){ + case 'week': + # need to get the first value of $next_range_unixtime onto the right day of the week + $next_range_unixtime = strtotime("this ".date("D", $start_date_unixtime), $next_range_unixtime); + break; + case 'year': + $end_range_unixtime += 366*24*60*60; + break; +} if(!isset($rrule_array['FREQ']) && isset($end_date)){ $end_range_unixtime = strtotime($end_date); $count = 1; -- cgit v1.2.3