#4040 closed defect (fixed)
iCal calendar from Trac roadmap is incomprehensible to Google Calendar
Reported by: | Jeffrey.Haemer | Owned by: | Christopher Lenz |
---|---|---|---|
Priority: | normal | Milestone: | 0.10.3 |
Component: | roadmap | Version: | 0.10 |
Severity: | normal | Keywords: | calendar patch |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
Trac publishes a Roadmap calendar, of milestones, in iCal format. These calendars add to or import into gCal, but no events display. Here's why:
A VEVENT
from Trac has date stamps in this format:
DTSTAMP;VALUE=DATE:20061016
Google Calendar expects iCal date stamps to have this format:
DTSTAMP;VALUE=DATE:20061016T222301Z
It appears that only the DTSTAMP field is the problem — all other date/time fields can have the first format.
Trac calendars do add or import successfully in Apple's iCal.
It would be useful to me, and the folks I work with, to be able to see Trac Roadmaps in Google Calendar. We may not be alone. :-)
Attachments (0)
Change History (8)
comment:1 by , 18 years ago
Description: | modified (diff) |
---|---|
Keywords: | calendar added |
comment:2 by , 18 years ago
comment:3 by , 18 years ago
As the original poster pointed out, the problem is not with all dates listed in the calendar, just the VEVENT
DTSTAMP
ones. So the changes listed in comment:2 might be a little broad. The desired change is from:
BEGIN:VEVENT UID:</trac/milestone/1.0.2@example.com/trac> DTSTAMP;VALUE=DATE:20061110 DTSTART;VALUE=DATE:20061110
to:
BEGIN:VEVENT UID:</trac/milestone/1.0.2@example.com/trac> DTSTAMP:20061110T222301Z DTSTART;VALUE=DATE:20061110
According to the iCal RFC 2445, the current implementation does not conform:
4.8.7.2 Date/Time Stamp
Property Name: DTSTAMP
Purpose: The property indicates the date/time that the instance of the iCalendar object was created.
Value Type: DATE-TIME
Description: The value MUST be specified in the UTC time format.
Example:
DTSTAMP:19971210T080000Z
comment:4 by , 18 years ago
You probably want something more like this (untested):
-
trac/ticket/roadmap.py
293 293 if milestone.has_key('due'): 294 294 write_prop('BEGIN', 'VEVENT') 295 295 write_prop('UID', uid) 296 write_ date('DTSTAMP', localtime(milestone['due']))296 write_utctime('DTSTAMP', localtime(milestone['due'])) 297 297 write_date('DTSTART', localtime(milestone['due'])) 298 298 write_prop('SUMMARY', 'Milestone %s' % milestone['name']) 299 299 write_prop('URL', req.base_url + '/milestone/' +
comment:5 by , 18 years ago
Keywords: | patch added |
---|---|
Milestone: | → 0.10.3 |
Summary: | iCal calendar from Trac roadmap incomprehensible to Google Calendar → iCal calendar from Trac roadmap is incomprehensible to Google Calendar |
I just tested the code in comment:4 and it worked for me on both Google Calendar and iCal.
comment:6 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I was able to simulate the desired time format by updating a single line of the write_date function ("write_prop…") in source:trunk/trac/ticket/roadmap.py:
But Google Calendar still cannot read my Trac Roadmap iCalendar file. It did seem to recognize the name of the calendar ("[projectname] - roadmap") after the fix though.
The above solution is not ideal, because the time specified should be Z as in Zulu = GMT. So the preferred time function to use would be gmtime instead of localtime. This function is not yet imported at the top of the file, but would look like so:
Please let me know (bbest@…) if anyone makes progress with this, as I would very much like to access these Roadmap iCalendars with Google Calendar. Trac + Google = good times ;)
Thanks!