Dates from a Google Calendar wrong

I'm trying to take a google calendar feed, search for specific words in the title and description and add the "CATEGORIES" attribute into the iCal feed that is emitted.

I've managed to do that except that the dates get mangled - when I reimport the final feed somewhere (in this case to Joomla JEvents, but it is the same if I reimport it to Google Calendar), the start and end dates appear to be in the 1970s.

I suspect it's something about the way that Pipes is interpreting the dates

There appears to be two "dtstart" (date start) parts item.y:dtstart and item.dtstart - the y:dtstart has a 1970 date, whereas the item.dtstart just has a number (e.g. 20131002). When I export the iCal from Google Calendar and look in notepad, the dates are correct.

Does anyone have any suggestions? The Pipe address is here for those that might be able to help http://pipes.yahoo.com/pipes/pipe.info?_id=9c4ddbd47d75bc5a5b99bcb5e44be9ba

Thanks in advance Chris

3 Replies
  • Hi chris did you find a solution ? i have the same problem

  • I did in the end.

    Yahoo needs the full date/time as one string. Unfortunately, when Google Calendar puts in full day events, it doesn't put a time and Yahoo gets confused when it outputs that.

    The way I got around it was to a) Find all day events and mark them (http://pipes.yahoo.com/pipes/pipe.edit?_id=8323e293270287622d212b72cd841040 - this pipe will check the length of the start date and time, if it only has a date then it's an all day event and it adds #AllDay to the description and corrects the date by adding an arbitrary time and then correcting item.y.dtstart and item.y.dtend Note that google stores its dates as item.dtstart, and item.dtend, these are strings which, if you add a time and put them through the datebuilder they will appear as a date item, which you need to add to item.y.dtstart and item.y.dtend

    b) The ical feed from the above pipe is put into another pipe where I screen for the words I want in the title and description and appends item.categories which then appear in the final ical feed (http://pipes.yahoo.com/pipes/pipe.edit?_id=8323e293270287622d212b72cd841040)

    c) I have a small php script on the site that deletes the times that were added for any events marked as #AllDay

    The JEvents appear on the front page of the site I'm an administrator for (http://www.emgat.org.uk)

    Hope that helps - it took a while to work out, and there's probably a much simpler solution, but I think it's down to the way that google outputs and yahoo imports iCals.

    Feel free to clone and have a look at the pipes


  • 0

Recent Posts

in Pipes