From: Wesley M. <we...@we...> - 2006-09-17 02:29:45
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Jim, I'm thinking this is a perfect cause where an OO approach might be best. Rather than trying to figure out how many times an event should repeat and on which days, maybe we should have an event structure/ object that given a date responds yes/no as it if it should be shown. I think the logic might turn out easier that way. IIRC, right now the parser looks at an event and then tries to figure out the specific times it shows up? It's been a long time since I've looked. I think it might be easier to figure out display dates given specific dates, rather than the other way around. Memoization can be used to eat a little more space in favor of avoiding duplicate computations. Do you think that might be better? Later, Wes On Sep 7, 2006, at 12:56 PM, Jim Hu wrote: > 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 > > > > ---------------------------------------------------------------------- > --- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Phpicalendar-devel mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpicalendar-devel - -- Wesley Miaw we...@we... -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (Darwin) iD8DBQFFDLMXQv4agqRAk2kRAoQHAKCnrWZfRt8C2sKCWFNZEqvqzD1oeQCgmwtN /IuWAksimmcvrJxxsa0oTi0= =g2jh -----END PGP SIGNATURE----- |