当前位置: 动力学知识库 > 问答 > 编程问答 >

RRULE 20 days after every 15th in a month,in icalendar (RFC 5545)?

问题描述:

I'm searching a way to express a situation like this in icalendar: an event happens every month, x days after a given date.

e.g.: 20 days after 15th day in every month. so, it might be 3rd, 4th, 5th,6th( like February )

if bymonthday can be set to 35, it's ok.

But in outlook this won't work.

How to solve this question?

网友答案:

You could perhaps try adding ";BYSETPOS=20" to the rule. The specification shows an example of BYSETPOS when using it with BYDAY, but it is not clear to me how it is handled when using BYMONTHDAY. I don't see another option looking at the spec.

http://icalendar.org/iCalendar-RFC-5545/3-3-10-recurrence-rule.html

http://icalendar.org/iCalendar-RFC-5545/3-8-5-3-recurrence-rule.html

网友答案:

Sorry, what you want is not possible with a RRULE.

What you want is RRULE:FREQ=MONTHLY;BYMONTHDAY=35. Unfortunately, it's invalid - BYMONTHDAY can't exceed 31.

BYSETPOS won't work either. In RFC 5545, page 43 under BYSETPOS is the following: "BYSETPOS operates on a set of recurrence instances in one interval of the recurrence rule." That means you can't get a value beyond the interval. If you use Monthly you are restricted to the one month.

If you want to experiment with some RRULEs try my recurrence rule (RRULE parser) at http://balsoftware.net/index.php/open-source/rrule-parser/

分享给朋友:
您可能感兴趣的文章:
随机阅读: