问题描述
我正在尝试为一组重复的日期创建一组日历事件,这些日历事件从该月的第一个星期一开始,然后在紧随其后的第二天创建一个事件(不一定是该月的第一个星期二,但该月的第一个星期一之后的第一个星期二),但我不确定如何使用高级iCalendar规则来做到这一点.
I'm trying to create a set of calendar events for a repeating set of days that starts on the first monday of the month, then has an event for the day immediately after that (not necessarily the first tuesday of the month, but the first tuesday after the first monday of the month), but I'm not sure how to do it with the advanced iCalendar rules.
https://www.kanzaki.com/docs/ical/recur.html显示您可以通过 BYSETPOS
在一组候选日期的第n个日期重复出现,但是即使有可能,我也无法弄清楚如何使该日期生效
https://www.kanzaki.com/docs/ical/recur.html shows that you can recur on the nth date in a set of candidate dates via BYSETPOS
, but I can't figure out how to make this work for my particular case, if that's even possible.
推荐答案
有时,以另一种方式表达具有相同效果的重复规则很有帮助.在这种情况下,只有在当天是星期二的情况下,我才能在每月BUT的2、3、4、5、6、7、8上进行每月重复.那应该总是在第一个星期一之后的第一个星期二.EG:如果第一天是星期二,则该规则将在每月的8号再次发生.
Sometimes it's helpful to think of another way of phrasing the recurrence rule with the same effect. In this case, I went with a Monthly recurrence on 2,3,4,5,6,7,8 of the month BUT only if that day is a Tuesday. That should always give you the first tuesday after the first monday. EG: If the 1st is the Tuesday, the rule will recur on the 8th of the Month.
RRULE:FREQ=MONTHLY;BYDAY=TU;BYMONTHDAY=2,3,4,5,6,7,8
在此处查看前几次重复: https://test.icalevents.com/event/first-tuesday-after-first-monday/
See first few recurrences here: https://test.icalevents.com/event/first-tuesday-after-first-monday/
这篇关于iCalendar对“每月第二个星期一后的第二天"重复规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!