How to have an iCalendar (RFC 2445) repeat YEARLY with duration

最后都变了- 提交于 2019-12-04 15:02:41

Try the BYMONTH rule to specify that you only want it in April and May:

RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=MO,WE,FR;BYMONTH=4,5;WKST=SU

This won't handle the "First Sunday of April" bit, which isn't in the MWF part of the pattern. I think this will be covered for the first occurrence if you set this specific date as your dtStart date (but of course, that won't recur for the next year by itself). Otherwise, I think you may need a second RRULE for that:

RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=4;WKST=SU

Does that help?

Todd,

Using the 3 RRULEs as you have above will produce a union of results, not an intersection. You're right that there isn't a very graceful way in RFC2445/5545. However, if you have the ability to programatically calculate the first Sunday in April while you generate the event, the following should work:

DTSTART:20090405T000000
RRULE:FREQ=YEARLY;BYDAY=MO,WE,FR;UNTIL=20090531T000000Z

This method at least seems closer to what you were trying to achieve.

-Doug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!