[#8510] Export of recurring event with Nth WeekDay is wrong
Summary Export of recurring event with Nth WeekDay is wrong
Queue Kronolith
Queue Version 2.3.1
Type Bug
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org
Requester lst_hoe02 (at) kwsoft (dot) de
Created 2009-08-20 (4169 days ago)
Updated 2009-08-21 (4168 days ago)
Assigned 2009-08-20 (4169 days ago)
Resolved 2009-08-21 (4168 days ago)
Patch Yes

2009-08-21 15:38:25 Jan Schneider Comment #6
Assigned to Jan Schneider
State ⇒ Resolved
Reply to this comment
Committed, thanks. Nice work!
2009-08-21 15:33:51 Jan Schneider Deleted Original Message
2009-08-21 11:16:03 lst_hoe02 (at) kwsoft (dot) de Comment #5
New Attachment: kronolith-patch2.zip Download
Reply to this comment
The attached path fixes the issue for iCal and vCal output and rename 
the variable $p to the more explaining $nth_weekday.

As far as i can see vCal has no expression for the 
HORDE_DATE_RECUR_YEARLY_WEEKDAY so this can be omitted for the 
"toRRule10" function?
2009-08-21 09:01:59 lst_hoe02 (at) kwsoft Comment #4 Reply to this comment
The used calculation is only wrong for the last 7 days of the month 
excluding the same weekday as the first monthday is. If one change the 
line 99 in kronolith/lib/tests/recurrence.phpt to use "2009-03-27 
10:00:00" the error should be detectable. The 27.03.2009 is the 4th 
friday in March but the result would be BYDAY=5FR.

The Basic Problem is, that the calculation is based on the weeknumber 
and the result should be the nth weekday which is off for weeks 
continue in the next month.
2009-08-20 20:32:44 lst_hoe02 (at) kwsoft (dot) de Comment #3 Reply to this comment
To reproduce simply create a event : today,recurs every 1 year on the 
same weekday and month of the year. This will lead to


at export, which should be


because today is the 3th Thursday this month and not the 4th as far as 
i can tell.

Could you explain where to find the unit test for this??


2009-08-20 16:17:49 Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
Can you provide a patch for the recurrence unit test that demonstrates 
the bug? The existing tests don't show any problem.
2009-08-20 14:58:28 lst_hoe02 (at) kwsoft (dot) de Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ Export of recurring event with Nth WeekDay is wrong
Queue ⇒ Kronolith
Milestone ⇒
Patch ⇒ Yes
New Attachment: kronolith-patch.zip
Reply to this comment
When using recurring events with Nth WeekDay of Month the export of 
the event is Nth+1 WeekDay eg. for 4th TU of AUG every Year the export 
result is 5th TU of AUG every Year. For Monthly schedules only the 
exception for dates at the end of month are sometimes wrong. The patch 
correct this for iCal export, it seams for vCalendar the same problem 
exists but i have to check with vCalendar doku first.

Saved Queries