Update of /cvsroot/phpicalendar/phpicalendar/functions
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21314/functions
Modified Files:
ical_parser.php
Log Message:
add support for WKST
Index: ical_parser.php
===================================================================
RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ical_parser.php,v
retrieving revision 1.209
retrieving revision 1.210
diff -C2 -d -r1.209 -r1.210
*** ical_parser.php 9 Apr 2006 00:32:48 -0000 1.209
--- ical_parser.php 10 Apr 2006 00:43:44 -0000 1.210
***************
*** 553,556 ****
--- 553,559 ----
$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';
***************
*** 573,578 ****
$day = two2threeCharDays($day);
#need to find the first day of the appropriate week.
! $the_sunday = dateOfWeek(date("Ymd",$next_range_time), 'Sunday');
$next_date_time = strtotime($day,strtotime($the_sunday)) + (12 * 60 * 60);
#reset $next_range_time to first instance in this week.
--- 576,587 ----
$day = two2threeCharDays($day);
#need to find the first day of the appropriate week.
! #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.
|