[uf-discuss] hCalendar-Recurring Events Help

Toby A Inkster mail at tobyinkster.co.uk
Sun Dec 7 04:29:13 PST 2008


iCalendar does include support for recurring events such as this.  
hCalendar is, according to its spec, "a 1:1 representation of [...]  
iCalendar". Thus is can be assumed that it does include support for  
recurring events, even if the spec is silent on exactly how to mark  
them up.

Because of the fact that hCalendar is so vague about how a number of  
iCalendar properties should be expressed in HTML, I've put together a  
completely unofficial, but hopefully helpful draft called "hCalendar  
1.1", which you can find here:

http://microformats.org/wiki/User:TobyInk/hcalendar-1.1

Now, in iCalendar, the way to express a recurrence of the first and  
third Friday of every month would be:

RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=1FR,3FR

The hCalendar draft allows two basic ways of marking this up. The  
first is a clumsy, all-in-one way, but is probably the best supported:

<abbr title="FREQ=MONTHLY;INTERVAL=1;BYDAY=1FR,3FR" class="rrule">the  
first and third Friday of every month</abbr>.

A slightly nicer way, though one which you'll find less parser  
support for would be:

<p class="rrule">
   On the <abbr class="byday" title="1FR">first</a>
   and <abbr class="byday" title="3FR">third friday</a>
   <abbr class="interval" title="1">of every</abbr>
   <abbr class="freq" title="monthly">month</abbr>.
</p>

Both of these markup styles are supported by Cognition <http:// 
buzzword.org.uk/cognition/>. Perhaps other parser maintainers could  
reply to this thread to say whether they support either/both.

Note that with RRULE you do still need to include a DTSTART (use this  
to indicate the start date and time of the first event in the  
sequence) and I'd recommend also including either a DURATION (i.e.  
the duration of each event) or a DTEND (i.e. the end time of the  
first event - not the date when you want the recurrence rule to finish).

RRULE is a singular property - that is, you can only have one  
recurrence rule per event, but these rules can get pretty  
complicated, so do manage to cover the vast majority of cases. Also  
of interest are RDATE, which allows you to list explicit dates when  
an event is repeated, and EXDATE and EXRULE which are their  
counterparts for excluding particular dates.

Hope that helps.

-- 
Toby A Inkster
<mailto:mail at tobyinkster.co.uk>
<http://tobyinkster.co.uk>





More information about the microformats-discuss mailing list