I have an iCal feed and it is working correctly with subscriptions via Google Calendars, Apple's iCal and iPhone calendar subscriptions, and events are correctly translated into the local timezone.

However, I have encountered a problem with importing the iCalendar feed to automatically create Facebook events, using the iCalendar-to-Facebook application. It appears that Facebook does not have a mechanism for setting a timezone for a page, so the iCal feed is imported in its native timezone. This works fine if you are on UTC but doesn't work for anyone else.

If the iCal feed put out by the Calendar module included times in the local timezone of the site, and included the appropriate timezone headers, then it would continue to work correctly in other applications, while also becoming more "opinionated", insofar as the iCal feed would now broadcast what it regards as its local timezone. This would fix the problem in facebook, and might conceivably fix issues elsewhere.

I'm not that familiar with this format, but from one source the data that it appears I need to add to my iCal feed for a New Zealand based site would appear to be:

BEGIN: VTIMEZONE
COMMENT: New Zealand Time (Daylight Saving)
DAYLIGHT: 1
TZNAME: NZD
TZOFFSET: +1300
RRULE; BYDAY=1SU;BYMONTH=10: YEARLY
END: VTIMEZONE

BEGIN: VTIMEZONE
COMMENT: New Zealand Time
DAYLIGHT: 0
TZNAME: NZS
TZOFFSET: +1200
RRULE; BYDAY=3SU;BYMONTH=03: YEARLY
END: VTIMEZONE

Is there any way with the existing module to inject this into my feed? If not, it would seem useful to add this functionality, even if it was just something people could add manually, say using the "HTML header" section of the iCal View or similar.

Comments

bdlangton’s picture

There is a way to fix this problem using a provided template file. Within the calendar module folder there is: calendar_ical/calendar-view-ical.tpl.php. Copy that template file into your theme's directory. Then you can open that file and insert the VTIMEZONE code in there, right before the "foreach($events as $event):" line in the file. For me, I am in CST, so I used this:

BEGIN:VTIMEZONE
TZID:CST
BEGIN:STANDARD
TZNAME:CST
TZOFFSETFROM:-0600
TZOFFSETTO:-0600
END:STANDARD
END:VTIMEZONE

After doing this, you will need to flush the cache so that Drupal knows about the new copy of calendar-view-ical.tpl.php in your theme directory.

Admittedly, I wanted to use code to factor in daylight savings time, like this example I found:

BEGIN:VTIMEZONE
TZID:US-Eastern
LAST-MODIFIED:19870101T000000Z
TZURL:http://zones.stds_r_us.net/tz/US-Eastern
BEGIN:STANDARD
DTSTART:19671029T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
TZNAME:EST
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:19870405T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
TZNAME:EDT
END:DAYLIGHT
END:VTIMEZONE

However, I was unable to get this to work with the iCal to Event facebook app. For some reason, it wasn't able to load in the events, so I reverted to the simpler example above and it worked.

TommyChris’s picture

This site provides a really good time zone sample files: http://tzurl.org/

Neslee Canil Pinto’s picture

Status: Active » Closed (outdated)

The D6 branch is no longer supported so we're closing this issue. If you think this issue still exists in D7 you can open a new one.