From: Jim Hu <ji...@ta...> - 2006-09-07 19:56:26
|
Been a while since I've emailed the list...but I've been trying to get time to do another bug fix release and I've run into something where I could use some thoughts on how to fix it. I was working on this bug: https://sourceforge.net/tracker/? func=detail&atid=500017&aid=1554268&group_id=62270 This is a case where the problematic event is: BEGIN:VEVENT RRULE:FREQ=WEEKLY;INTERVAL=1;COUNT=2;BYDAY=TU,TH;WKST=SU DURATION:PT1H DTSTAMP:20060907T173732Z UID:F6E3F1E5-3E8D-11DB-AFA8-000D93B8CD32 SEQUENCE:7 DTSTART;TZID=America/Denver:20060907T110000 SUMMARY:tue thurs ORGANIZER;CN="scott schmitz":mailto:sc...@re... END:VEVENT The problem is that this displays the first Thurs instance correctly, but not the next Tuesday. Looking at the code for ical_parser.php, it seems to me like $count is counting the number of days, weeks, months, or years in a repeat, not the number of times the event itself is repeating. If I'm right, then I think a major change to the parser is needed. As it stands, $count shows up at the beginning of the big while loop that handles END:VEVENT in: ====== 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); if ($diff < $count) { .... ====== The $freq_type.'Compare' functions are in date_functions.php. These just return the number of days, weeks, etc. between two dates. There are a bunch of ways this can fail to work, for example, if RRULE:FREQ=WEEKLY;INTERVAL=1;COUNT=2;BYDAY=MO,TU,WE,TH,FR;WKST=SU The calendar should only show the occurrences on MO and TU...but it will show all of them in the one week. Any thoughts? Jim ===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054 |