views:

292

answers:

1

I'm using Ruby Rical to basically generate an icalendar as a response to an original icalendar specifing that I'm attending (accepting) the invitation.

I can generate the response correctly but I'm having a problem with timezones, basically if I let RiCal infer the correct Timezone, it works correctly depending on the TimeZone String specified in the original file.

Let me put this in examples:

I can reply this invitation from Google Calendar without problems:

BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20091226T210000Z
DTEND:20091226T220000Z
DTSTAMP:20091223T191926Z
ORGANIZER;CN=xxx xxx:mailto:[email protected]
UID:[email protected]
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=TRUE;CN=xxxx xxxx;X-NUM-GUESTS=0:mailto:[email protected]
CREATED:20091223T191925Z
DESCRIPTION:View your event at 4NmIxMmM1ZmJiODM4OTEx&ctz=America%2FLos_Angeles&hl=en.
LAST-MODIFIED:20091223T191925Z
LOCATION:800-292-2393 pin 1234
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:test google calendar attendance response
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR

But I'm getting an error (no such file to load -- tzinfo/definitions/US/Pacific) when I generate the response to an Ical (Mac Ical.app) invitation:

BEGIN:VCALENDAR
CALSCALE:GREGORIAN
VERSION:2.0
METHOD:REQUEST
PRODID:-//Apple Inc.//iCal 4.0.1//EN
BEGIN:VTIMEZONE
TZID:US/Pacific
BEGIN:DAYLIGHT
TZOFFSETFROM:-0800
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
DTSTART:20070311T020000
TZNAME:PDT
TZOFFSETTO:-0700
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:-0700
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
DTSTART:20071104T020000
TZNAME:PST
TZOFFSETTO:-0800
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
ATTENDEE;CN="[email protected]";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTI
 ON;RSVP=TRUE:mailto:[email protected]
DTEND;TZID=US/Pacific:20091231T091500

As you see TZID:US/Pacific is an invalid time zone indentifier for RiCal, so in these cases.. How would you do to answer this type of icalendar using Rical and conserving the original Timezone?

Please if I'm not clear with the question, ask me anything that you need.

+1  A: 

I think RiCal uses TZInfo for its timezone support. You are presumably currently using the cut-down version of TZInfo that is included in Ruby on Rails' ActiveSupport library. This doesn't contain the US/Pacific timezone definition that you need.

The full version of TZInfo does include US/Pacific. If you install the tzinfo gem and then restart your Rails app, you should find that this works.

Phil Ross
WOW this is so cool, going to check this right now :)
ClaudioA