I am trying to create 2 events that have custom repeats but I can't quite figure out the coding.
-
I need an event that happens every 30 days but if the 30th day is a weekend I'd like it to move to the following Monday. But I also need it to stay on the original 30 day cycle.
-
I also need an event that happens x week days before x day of the month. For instance I'd like an event that happens 3 weekdays before the 15th of every month.
Any help would be great.
Best Answer
To clarify, I meant write a program that creates an iCalendar, but lists dates explicitly instead of using an RRULE.
While there are several iCal creators online, I don't think any of them will handle the complexity of the rules you need, especially the first one.
You might find an RRULE for your second condition, but I found it easier to simply write a program.
Overall, although RRULE is a nice tool, it can't do everything. Sometimes, you just have to specify the dates yourself, which also gives you more flexibility to use other calendar formats which may not support RRULE.
I've now written:
https://github.com/barrycarter/bcapps/blob/master/STACK/bc-blank-ical.pl
and created these blank iCalendars per your date rules above.
http://oneoff.barrycarter.info/webapps-90641-1.ics
http://oneoff.barrycarter.info/webapps-90641-2.ics
Important notes:
Be sure to check my work: make sure the dates in the calendar are the dates you actually want.
For your first rule, I arbitrarily assumed the first event was on February 1st. You should tweak my program to generate the correct date (or contact me (see profile), and I can do this).
For your second rule, I created events from 2016 through 2037 inclusive.
To use these calendars, search/replace all instances of
_SUMMARY_
with the actual summary of your event, all instances of_DESCRIPTION_
with the description, and so on. The calendars I created only have dates and randomly generated UIDs.You should also change the PRODID of each calendar.
While I personally don't object, I'm not sure this question actually belongs on webapps, since its not about an existing web application.