Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create "recurData" in Google Calendar?

I want to create recurring events of Calendar using Google API. I am following links:

  1. Google Calendar API

    I am not getting how to create "recurData". I can't modify String and pass it as parameter. Tried DDay.iCal Version 0.80. also.

  2. DDay.iCal

There are some Example code given.I tried them. I am able to create ".ics" file.

But when i pass this file content as "recurData"

Getting Error : {"Execution of request failed: http://www.google.com/calendar/feeds/[email protected]/private/full?gsessionid=AHItK5wrSIoJVawFjGt-0g"}

My icf File content is:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//DDay.iCal//NONSGML ddaysoftware.com//EN
BEGIN:VEVENT
CREATED:20100309T132930Z
DESCRIPTION:The event description
DTEND:20100310T020000
DTSTAMP:20100309T132930Z
DTSTART:20100309T080000
LOCATION:Event location
SEQUENCE:0
SUMMARY:18 hour event summary
UID:396c6b22-277f-4496-bbe1-d3692dc1b223
END:VEVENT
BEGIN:VEVENT
CREATED:20100309T132930Z
DTEND;VALUE=DATE:20100315
DTSTAMP:20100309T132930Z
DTSTART;VALUE=DATE:20100314
SEQUENCE:0
SUMMARY:All-day event
UID:ac25cdaf-4e95-49ad-a770-f04f3afc1a2f
END:VEVENT
END:VCALENDAR

I made it using "Example6".

like image 223
Preeti Avatar asked Mar 09 '10 13:03

Preeti


1 Answers

It think this sample will tell us, that you create your Calendar Entry with the EventEntry Class. Then you pass a recurrence to that entry.

In google's example the DTSTART and DTEND Fields are representing the start and end of the recurrence.

EventEntry myEntry = new EventEntry();
myEntry.Title.Text = "Hello recurring Event!";
// Set a location for the event.
Where eventLocation = new Where();
eventLocation.ValueString = "here and there";
entry.Locations.Add(eventLocation);

// Any other event properties

// Recurring event:
String recurData =
  "DTSTART;VALUE=DATE:20070501\r\n" +
  "DTEND;VALUE=DATE:20070502\r\n" +
  "RRULE:FREQ=WEEKLY;BYDAY=Tu;UNTIL=20070904\r\n";

Recurrence recurrence = new Recurrence();
recurrence.Value = recurData;
myEntry.Recurrence = recurrence;
like image 93
Arthur Avatar answered Nov 02 '22 04:11

Arthur