Re: Reading Apple Calendar
Re: Reading Apple Calendar
- Subject: Re: Reading Apple Calendar
- From: Nigel Garvey <email@hidden>
- Date: Sun, 08 Sep 2013 15:36:12 +0100
Stan Cleveland wrote on Fri, 06 Sep 2013 18:35:17 -0700:
>On Sep 6, 2013, at 5:23 PM, Nigel Garvey wrote:
>
>> It would have to be a MONTHLY recurrence...
>
>Odd. The Friday the 13th example in my message was right from the Wiki
of
>the Google code Java library project.
I found a "Friday 13th" example in the RFC 2445 document itself
yesterday morning which uses a MONTHLY rule. I haven't been able to get
a DAILY one to work with BYMONTHDAY in Calendar, but a YEARLY one works:
"FREQ=YEARLY;INTERVAL=1;BYMONTH=1,2,3,4,5,6,7,8,9,10,11,12;BYMONTHDAY=13;BYDAY=FR"
Your "Friday 13th" post was a revelation for me. I knew that
iCal/Calendar could follow recurrence rules which weren't settable
through its GUI, but I hadn't twigged before that it was possible to
combine BYDAY and BYMONTHDAY in the same rule to have repeats expressed
only where both were satisfied. If I'd known this when setting up my
repeating events for the UK's three non-festival bank-holiday weekends,
I should very quickly have come up with the following rule for the
August one, where the holiday itself is the last Monday in the month and
I want to include the two days before that:
"FREQ=YEARLY;INTERVAL=1;BYMONTH=8;BYMONTHDAY=23,24,25,26,27,28,29;BYDAY=SA"
Or possibly, using BYYEARDAY instead and counting from the end of the
year to avoid any leap-day problems:
"FREQ=YEARLY;INTERVAL=1;BYYEARDAY=-131,-130,-129,-128,-127,-126,-125;BYDAY=SA"
Without this knowledge, the rule I actually used after a lot of trial
and error was:
"FREQ=YEARLY;INTERVAL=1;BYWEEKNO=-19;WKST=MO;BYDAY=SA"
… which being interpreted means "the Saturday of the nineteenth
Monday-start week before the end of each year."
The BYYEARDAY idea's particularly good for our "May Day" bank holiday,
where the holiday's the first Monday in May and the Saturday immediately
before it could be in either April or May. (My original solution
specified the Saturday of the thirty-fifth Friday-start week before the
end of each year!) In fact, BYYEARDAY would allow a single repeating
event to represent all three holiday weekends generically:
"FREQ=YEARLY;INTERVAL=1;BYYEARDAY=-247,-246,-245,-244,-243,-242,-241,-223,-222,-221,-220,-219,-218,-217,-131,-130,-129,-128,-127,-126,-125;BYDAY=SA"
NG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden