Can iCal schedule an event for the first weekday after BYMONTHDAY if BYMONTHDAY is a weekend?

杀马特。学长 韩版系。学妹 提交于 2021-02-07 14:31:21

问题


If I have a recurring event on a given day of the month (i.e. the 15th) and that day falls on a Saturday or a Sunday, is it possible for iCal to instead schedule the event to occur on the next available week day?


回答1:


you cannot set exception but you can use a combination of byday and bymonthday: something like will give you the monday after a week-end which had either on saturday or sunday a 15th.

RRULE:FREQ=MONTHLY;BYDAY=MO;BYMONTHDAY=16,17

By combining with another event: RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYMONTHDAY=15

you'll be there




回答2:


Using the BYSETPOS=1 rule part, you can accomplish this in a single event:

RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYMONTHDAY=15,16,17;BYSETPOS=1

This tells iCal to repeat the event monthly; to repeat it only Monday-Friday; to repeat it only on the 15th-17th; and to repeat it only on the first day (per month) that matches the previous rule parts.

BYSETPOS just tells iCal to choose the Nth occurrence of the set of occurrences matched by the other rule parts. It can be set to a comma separated list of values from 1 to 366 or -366 to -1.

For example, modifying the above rule to have BYMONTHDAY=15,16,17,29,29,30,31 and BYSETPOS=1,-1 will cause the event to repeat on the first weekday on or after the 15th, and the last weekday in the month.

Source: RFC 2445



来源:https://stackoverflow.com/questions/18101167/can-ical-schedule-an-event-for-the-first-weekday-after-bymonthday-if-bymonthday

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