38

I'm creating a iCal subscription calendar which is all working as expected; except I can't seem to specify seemingly basic things such as a default name to suggest to the client for the calendar, a description, and how often it should refresh.

I did find this specification revision: https://datatracker.ietf.org/doc/html/draft-daboo-icalendar-extensions-06

It does suggest that I can simply pass in the fields I want. Having done this and with the top of the ics file looking like this:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//My Company//NONSGML Event Calendar//EN
URL:http://my.calendar/url
NAME:My Calendar Name
DESCRIPTION:A description of my calendar
TIMEZONE-ID:Europe/London
REFRESH-INTERVAL;VALUE=DURATION:P1D
COLOR:34:50:105
CALSCALE:GREGORIAN
METHOD:PUBLISH

I'm simply finding that whilst no device/app that I've tried rejects the calendar, they are all ignoring the properties. I've used Outlook 2010, an iPhone on iOS 6, and Google Calendar. Outlook claims to respect some sort of refresh interval in the file, but when I subscribe my calendar - it says it's unspecified.

So the question is are these properties supported, or do I need to specify them as something else for each different client, or am I just plain out of luck?

Community
  • 1
  • 1
Codecraft
  • 8,291
  • 4
  • 28
  • 45

3 Answers3

56

It turns out the answer was hiding in plain sight. The properties above are a draft proposal at the moment and unsupported by anything I tried. It's probably a good bet to include them in your calendar for the future - but for it to work now as well, do it like this:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//My Company//NONSGML Event Calendar//EN
URL:http://my.calendar/url
NAME:My Calendar Name
X-WR-CALNAME:My Calendar Name
DESCRIPTION:A description of my calendar
X-WR-CALDESC:A description of my calendar
TIMEZONE-ID:Europe/London
X-WR-TIMEZONE:Europe/London
REFRESH-INTERVAL;VALUE=DURATION:PT12H
X-PUBLISHED-TTL:PT12H
COLOR:34:50:105
CALSCALE:GREGORIAN
METHOD:PUBLISH

The actual working properties at the moment being:

X-WR-CALNAME
X-WR-CALDESC
X-WR-TIMEZONE
X-PUBLISHED-TTL
Codecraft
  • 8,291
  • 4
  • 28
  • 45
  • Nope, I had wanted to get that working too but nothing I tried at the time had any effect. – Codecraft Oct 14 '14 at 21:28
  • Mac OSX 10.11.6 still only allows the ```X-``` type properties - do any mainstream clients use the 'draft' format (three years on!)? – developius Sep 28 '16 at 21:13
  • 4
    Does anyone know how to specify calendar name for Google Calendar? – The Onin May 30 '17 at 20:10
  • Google Calendar should accept X-WR-CALNAME. Make sure you're properly escaping it and there's no space after the colon. https://evertpot.com/escaping-in-vcards-and-icalendar/ – Ryan Villanueva Aug 30 '18 at 19:54
  • It seems that Google Calendar still uses the `X-` extensions for calendar name and description (based on an exported calendar). Furthermore, the `X-WR-CALDESC` property seems to be limited to 255 characters in some applications (as Google Calendar limits calendar descriptions to 255 characters). See [this spec](https://learn.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxcical/9194db93-6de2-41b3-bebe-fc76a11e31e9) for more information. – Zack Apr 20 '21 at 17:01
12

For those using rails gem 'iCalendar' with version 2.3.0. Below is the solution to set custom properties like calendar name.

calendar = Icalendar::Calendar.new 
calendar.append_custom_property("X-WR-CALNAME","My Calendar")
Dave
  • 4,376
  • 3
  • 24
  • 37
  • 2
    Thank you so much for sharing this! I've been trying to track this down. +1 – markquezada Jun 03 '16 at 00:13
  • 2
    `calendar.append_custom_property("REFRESH-INTERVAL;VALUE=DURATION","P1H")` for the REFRESH-INTERVAL property to refresh every hour – konyak Jul 14 '18 at 06:23
3

Another option with the icalendar Ruby gem:

calendar = Icalendar::Calendar.new
calendar.x_wr_calname = 'Calendar Name'
Richard Jones
  • 4,760
  • 3
  • 27
  • 34