After trying to deduce why my iCal feed was not being accepted by google calendar once there was a body field in place, I ran it through http://severinghaus.org/projects/icv/ to check for validation. There were a number of problems, including DSTAMP format issue, RRULE format issue, and improper formating on a long block as is often used for DESCRIPTION.

The attached patch brings my environment into full compliance with that validator. The changes all look valid when compared to the spec. I'm happy to rework it for inclusion if there are concerns on it.

CommentFileSizeAuthor
icalfix.patch2.57 KBsdague
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markDrupal’s picture

Version: 6.x-2.2 » 6.x-2.x-dev

Applied to my local copy of calendar CVS version. Works nicely.
Thanks.

glen201’s picture

Hi, thanks for the patch.

However, the iCal still doesn't pass the validator in this post: #676264: iCal feeds not passing new validator

I get the error for each calendar entry:

The time zone with the TZID 'America/New_York' was not found. Ensure the corresponding VTIMEZONE for TZID 'America/New_York' is contained in the calendar.

However, it seems to work fine in all calendars EXCEPT for Outlook 2003 which is putting everything at GMT and definitely not picking up the time zone info.

--glen

markDrupal’s picture

I've struggled with the same timezone issue.

It looks linux timezones (?) are not always supported. From the iCal documentation

For example, the following represents 2 AM in
New York on Janurary 19, 1998:

DTSTART;TZID=US-Eastern:19980119T020000

http://www.kanzaki.com/docs/ical/dateTime.html
http://www.kanzaki.com/docs/ical/tzid.html

An example of time zones can be seen on the second page above.

The following are examples of non-globally unique time zone
identifiers:

TZID:US-Eastern

TZID:California-Los_Angeles

glen201’s picture

I'm not understanding the docs. Does the VTIMEZONE have to appear with each calendar entry, or just once in the ical feed?

I wouldn't mind hard-coding something (it's Drupal, after all, gotta love the path) into the module for each site, just to pass validation and maybe get Outlook 2003 to work properly with the feed.

-- glen

KarenS’s picture

The VTIMEZONE is supposed to appear once in each feed and describes all the timezone adjustments. It is basically an RRULE for the timezone itself. It would be non-trivial to create a VTIMEZONE entry for each feed, I have no idea how to do it. And my experience is that my feeds can be imported fine into Google and elsewhere without it, so I was not planning to add it in. If someone knows a way to do it I'm open for ideas, but as far as I can tell, it would be very hard to do.

sdague’s picture

The RFC spec does require that if you use a named timezone, you specify the recurance rules, there are no such things as predefined timezones as far as the spec is concerned. Building the RRULE on the fly would sort of suck, so I've pondered building a library that would precompute those ical RRULES in advance by parsing the root tz files.

That being said, Google Calendar and Thunderbird/Lightning don't care if it's a standard timezone (like "America/New_York"), so for a lot of users this makes things much better. I couldn't add my ical into google calendar before I did these changes.

jakemonO’s picture

does anyone know who maintains ical feeds for groups.drupal.org? Having a Google parsing issue...
See: http://groups.drupal.org/node/48613

hawleyal’s picture

I'm getting newline warnings and timezone.

BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
X-WR-CALNAME: *
PRODID:-//Drupal iCal API//EN
BEGIN:VEVENT
UID:calendar:140:field_date:0:0
SUMMARY:Faculty and staff meeting
DTSTAMP;TZID=America/Detroit;VALUE=DATE-TIME:20100330T122326
DTSTART;TZID=America/Detroit;VALUE=DATE-TIME:20100402T081500
DTEND;TZID=America/Detroit;VALUE=DATE-TIME:20100402T093000
URL;VALUE=URI:https://*/node/140
END:VEVENT
END:VCALENDAR
Your calendar is using an invalid newline format. Make sure to use \r\n to end lines rather than just \n  (RFC 2445 §4.1).
Sorry, your calendar could not be parsed.
Error: 	Error was: Error at line 9: Cannot set timezone for UTC properties
Cause: 	Caused by: Cannot set timezone for UTC properties
Context for line 9:
6: 	BEGIN:VEVENT
7: 	UID:calendar:140:field_date:0:0
8: 	SUMMARY:Faculty and staff meeting
9: 	DTSTAMP;TZID=America/Detroit;VALUE=DATE-TIME:20100330T122326
10: 	DTSTART;TZID=America/Detroit;VALUE=DATE-TIME:20100402T081500
11: 	DTEND;TZID=America/Detroit;VALUE=DATE-TIME:20100402T093000
12: 	URL;VALUE=URI:https://*/node/140 
hawleyal’s picture

Status: Active » Needs review
Issue tags: +export, +import, +Timezone, +ical, +utc, +outlook, +ics

Here's a patch to force UTC timezone for iCal feeds.

Patch!
Change: force UTC timezone
Calendar: 6.x-2.x-dev (2010-Feb-28)

  • Change the timezone to UTC for the events in the theme include
  • Forces UTC timezone in the template

Source: Issue #757498, Comment #2

skwashd’s picture

I have been working on RFC 2445 compliance, I have submitted #760316: calendar_ical isn't RFC compliant which deals with this issue, and some others. I'd welcome any feedback.

stephenhendry’s picture

subscribe

Herc’s picture

Regards entry 8#
The parser is actually telling you the answer, if you read it carefully.

The DTSTAMP must be a UTC date time as per the spec. Hence you "cannot set a timezone for a UTC property"!

This is used for sequencing, so it is presumed easier if anyone is working to UTC.
UTC dates also end in with "z"

Herc

KarenS’s picture

Status: Needs review » Closed (duplicate)

As near as I can tell, everything here is already addressed in #760316: calendar_ical isn't RFC compliant, so marking this a dup.