aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2006-04-10 00:43:44 +0000
committerJim Hu <jimhu@users.sourceforge.net>2006-04-10 00:43:44 +0000
commit9c2b9c81261abf33fb945e7082339da8140e7f12 (patch)
treea25e0515fedcc408bb4c13c43af7847e0d2638b2
parent73ee9222e0cd5aa8cc2435b3b7770bf68ba8a34e (diff)
downloadphpicalendar-9c2b9c81261abf33fb945e7082339da8140e7f12.tar.gz
phpicalendar-9c2b9c81261abf33fb945e7082339da8140e7f12.tar.bz2
phpicalendar-9c2b9c81261abf33fb945e7082339da8140e7f12.zip
add support for WKST
-rw-r--r--functions/ical_parser.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index 855f782..945f010 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -552,6 +552,9 @@ foreach ($cal_filelist as $cal_key=>$filename) {
$count_to = 0;
// start at the $start_range and go until we hit the end of our range.
+ if(!isset($wkst)) $wkst='Su';
+ $wkst3char = two2threeCharDays($wkst);
+
while (($next_range_time >= $start_range_time_tmp) && ($next_range_time <= $end_range_time_tmp) && ($count_to != $count)) {
$func = $freq_type.'Compare';
$diff = $func(date('Ymd',$next_range_time), $start_date);
@@ -572,8 +575,14 @@ foreach ($cal_filelist as $cal_key=>$filename) {
foreach($byday as $day) {
$day = two2threeCharDays($day);
#need to find the first day of the appropriate week.
- $the_sunday = dateOfWeek(date("Ymd",$next_range_time), 'Sunday');
+ #dateOfweek uses weekstartday as a global variable. This has to be changed to $wkst,
+ #but then needs to be reset for other functions
+ $week_start_day_tmp = $week_start_day;
+ $week_start_day = $wkst3char;
+
+ $the_sunday = dateOfWeek(date("Ymd",$next_range_time), $wkst3char);
$next_date_time = strtotime($day,strtotime($the_sunday)) + (12 * 60 * 60);
+ $week_start_day = $week_start_day_tmp; #see above reset to global value
#reset $next_range_time to first instance in this week.
if ($next_date_time < $next_range_time){

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