From: <cl...@us...> - 2003-09-20 19:13:19
|
Update of /cvsroot/phpicalendar/phpicalendar/functions In directory sc8-pr-cvs1:/tmp/cvs-serv31153/functions Modified Files: ical_parser.php list_icals.php Log Message: Added BYYEARDAY support, added getdate to switching calendars. Index: ical_parser.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ical_parser.php,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** ical_parser.php 20 Sep 2003 00:37:36 -0000 1.106 --- ical_parser.php 20 Sep 2003 19:13:12 -0000 1.107 *************** *** 210,217 **** // Handling of the all day events if ((isset($allday_start) && $allday_start != '')) { ! $start = strtotime($allday_start); ! if (isset($allday_end)) { ! $end = strtotime($allday_end); ! } else { $end = strtotime('+1 day', $start); } --- 210,220 ---- // Handling of the all day events if ((isset($allday_start) && $allday_start != '')) { ! $start = strtotime($allday_start); ! if ($spans_day) { ! $allday_end = date('Ymd',$end_unixtime); ! } ! if (isset($allday_end)) { ! $end = strtotime($allday_end); ! } else { $end = strtotime('+1 day', $start); } *************** *** 506,509 **** --- 509,525 ---- $recur_data[] = $next_date_time; } + foreach ($byyearday as $yearday) { + ereg ('([-\+]{0,1})?([0-9]{1,3})', $yearday, $byyearday_arr); + if ($byyearday_arr[1] == '-') { + $ydtime = mktime(0,0,0,12,31,$this_year); + $yearnum = $byyearday_arr[2] - 1; + $next_date_time = strtotime('-'.$yearnum.' days', $ydtime); + } else { + $ydtime = mktime(0,0,0,1,1,$this_year); + $yearnum = $byyearday_arr[2] - 1; + $next_date_time = strtotime('+'.$yearnum.' days', $ydtime); + } + $recur_data[] = $next_date_time; + } break; default: *************** *** 741,744 **** --- 757,761 ---- $allday_start = $data; $start_date = $allday_start; + $start_unixtime = strtotime($data); } else { if (preg_match("/^DTSTART;TZID=/i", $field)) { Index: list_icals.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/list_icals.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** list_icals.php 20 Sep 2003 00:16:05 -0000 1.16 --- list_icals.php 20 Sep 2003 19:13:13 -0000 1.17 *************** *** 31,37 **** if (!in_array($cal_filename_tmp, $blacklisted_cals)) { if ($cal_tmp == $cal) { ! print "<option value=\"$current_view.php?cal=$cal_tmp\" selected>$cal_displayname_tmp $calendar_lang</option>"; } else { ! print "<option value=\"$current_view.php?cal=$cal_tmp\">$cal_displayname_tmp $calendar_lang</option>"; } } --- 31,37 ---- if (!in_array($cal_filename_tmp, $blacklisted_cals)) { if ($cal_tmp == $cal) { ! print "<option value=\"$current_view.php?cal=$cal_tmp&getdate=$getdate\" selected>$cal_displayname_tmp $calendar_lang</option>"; } else { ! print "<option value=\"$current_view.php?cal=$cal_tmp&getdate=$getdate\">$cal_displayname_tmp $calendar_lang</option>"; } } *************** *** 40,46 **** // option to open all (non-web) calenders together if ($cal == $ALL_CALENDARS_COMBINED) { ! print "<option value=\"$current_view.php?cal=$ALL_CALENDARS_COMBINED\" selected>$all_cal_comb_lang</option>"; } else { ! print "<option value=\"$current_view.php?cal=$ALL_CALENDARS_COMBINED\">$all_cal_comb_lang</option>"; } --- 40,46 ---- // option to open all (non-web) calenders together if ($cal == $ALL_CALENDARS_COMBINED) { ! print "<option value=\"$current_view.php?cal=$ALL_CALENDARS_COMBINED&getdate=$getdate\" selected>$all_cal_comb_lang</option>"; } else { ! print "<option value=\"$current_view.php?cal=$ALL_CALENDARS_COMBINED&getdate=$getdate\">$all_cal_comb_lang</option>"; } *************** *** 52,58 **** $cal_encoded_tmp = urlencode($cal_tmp); if ($cal_tmp == $cal_httpPrefix || $cal_tmp == $cal_webcalPrefix) { ! print "<option value=\"$current_view.php?cal=$cal_encoded_tmp\" selected>$cal_displayname_tmp Webcal</option>"; } else { ! print "<option value=\"$current_view.php?cal=$cal_encoded_tmp\">$cal_displayname_tmp Webcal</option>"; } } --- 52,58 ---- $cal_encoded_tmp = urlencode($cal_tmp); if ($cal_tmp == $cal_httpPrefix || $cal_tmp == $cal_webcalPrefix) { ! print "<option value=\"$current_view.php?cal=$cal_encoded_tmp&getdate=$getdate\" selected>$cal_displayname_tmp Webcal</option>"; } else { ! print "<option value=\"$current_view.php?cal=$cal_encoded_tmp&getdate=$getdate\">$cal_displayname_tmp Webcal</option>"; } } |