Menu

#1 "BYDATE=" errors

open
nobody
None
5
2005-10-14
2005-10-14
Zan Hecht
No

I noticed a bug in your program where reoccurring
appointments that don’t have a BYDAY attribute show up
incorrectly in PHP iCalendar. Basically, If a RRULE:
line ends in BYDAY=, the event seems to show up at the
incorrect date (this may be a bug in PHP iCalendar).
This is easily fixed by making sure that ;BYDAY= is
only appended when daysOfWeek is unequal to "". I’m not
too familiar with VB script (I found and fixed this bug
in the JavaScript version), but I think the fix is to
add the following line to the end of the days_of_week
function:

If days_of_week <> "" then
days_of_week = ";BYDAY=" & days_of_week
End If

And all calls to days_of_week must be modified to not
append ";BYDAY=". For example:

str = str & ";BYDAY=" & days_of_week("", myPattern)

would become

str = str & days_of_week("", myPattern)

Other than that minor bug, I have really enjoyed this
program, as it has made uploading my calendar much easier.

Discussion

  • Zan Hecht

    Zan Hecht - 2006-06-08

    Logged In: YES
    user_id=627550

    For those interested in patching the .JS version (instead of
    the VB script), the changes are listed below:

    To fix the above bug, add the following line before "return
    daysOfWeek;"

    if (daysOfWeek != "") daysOfWeek = ";BYDAY=" + daysOfWeek;

    And then modifying all the times daysOfWeek is called so
    that ";BYDAY=" is not appended. For example:

    recurEvent += ";BYWEEK=-1;BYDAY=" & daysOfWeek("", pattern);

    would become

    recurEvent += ";BYWEEK=-1" & daysOfWeek("", pattern);

    To fix an addition bug when using it with Outlook 2003:

    Add the following line at the beginning of the function
    monthNum(month):

    var month = month + "";

    and the following lines at the end of the if statement:

    else {
    monthNum = month;
    }

    And replace the line "return monthnum;" with

    return monthNum;

     
  • Zan Hecht

    Zan Hecht - 2006-06-08

    Patched VB script file

     
  • Zan Hecht

    Zan Hecht - 2006-06-09

    Patched JS file

     
  • Nobody/Anonymous

    Logged In: NO

    Note that having an empty BYDAY= rule part violates RFC 2445, and calendaring programs which adhere closely to the spec (i.e., Google Calendar) will reject files with illegal ruls.

     
  • Iain Shepherd

    Iain Shepherd - 2010-05-02

    (Bug 1569994 also covers this)

     

Log in to post a comment.

MongoDB Logo MongoDB