aboutsummaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2008-12-24 08:49:37 +0000
committerJim Hu <jimhu@users.sourceforge.net>2008-12-24 08:49:37 +0000
commite0e757c985b56ad5968bc1ecc8141da7726241fa (patch)
treef50b318f4bf9f390dd09f25212831aa2fb9edd50 /functions
parente3ab6964c71c936477a8085a3811848c349b915d (diff)
downloadphpicalendar-e0e757c985b56ad5968bc1ecc8141da7726241fa.tar.gz
phpicalendar-e0e757c985b56ad5968bc1ecc8141da7726241fa.tar.bz2
phpicalendar-e0e757c985b56ad5968bc1ecc8141da7726241fa.zip
fix starting date range for freq weekly
Diffstat (limited to 'functions')
-rw-r--r--functions/parse/end_vevent.php11
1 files changed, 10 insertions, 1 deletions
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;

© 2014-2024 Faster IT GmbH | imprint | privacy policy