hCalendar, Microformats and Google Calendar


I wanted to add hcalendar-microformatted data to London Cinema Today, so that events could be exported to Google Calendar. The event title, venue title and start date were already present. I ended up having to do the following:

  • Turn the start time from a span into an abbr, so the ISO-formatted datetime could go in the title attribute.
  • Add an empty abbr to contain the ISO-formatted end time in its title attribute.
  • Add a hidden span containing the summary of the event, as Google Calendar uses this when it shows the event and it's not possible to combine multiple summary elements to put both the event title and venue title in the summary.
  • Add a hidden span containing the location information. This has to be just the postcode and 'UK', as Google Calendar uses this to display the map and if you use the full address it runs a 'local business' search for that address rather than just pointing to the postcode location. I don't think it's possible to pass a latitude/longitude to Google Calendar(?).

I can't help thinking it would have been easier to use unAPI to point to an ICS file containing the full event information... but Operator doesn't support unAPI.