2012-01-07 61 views
1

使用下面的代碼,我還沒有能夠推動谷歌日曆的任何經常性事件。然而,從事件中取消「重複」項目並且它可以工作。谷歌日曆再次發生紅寶石API V3

我在做什麼錯?

event = { 
    'summary' => 'Appointment', 
    'location' => 'Somewhere', 
    'start' => { 
     'dateTime' => '2011-06-03T10:00:00.000-07:00' 
    }, 
    'end' => { 
     'dateTime' => '2011-06-03T10:25:00.000-07:00' 
    }, 
    'recurrence' => [ 
     "RRULE:FREQ=DAILY;COUNT=5" 
    ] 
    } 

    result = @client.execute(:api_method => @service.events.insert, 
        :parameters => {'calendarId' => '[email protected]'}, 
        :body_object => event, 
        :headers => {'Content-Type' => 'application/json'}) 
    puts result.data.id.to_s 

回答

1

的時區,需要在一個單獨的字段設置爲這個

event = { 
    'summary' => 'Appointment', 
    'location' => 'Somewhere', 
    'start' => { 
    'dateTime' => '2011-06-03T10:00:00.000-07:00', 
    'timeZone' => 'America/Montreal' 
    }, 
    'end' => { 
    'dateTime' => '2011-06-03T10:25:00.000-07:00', 
    'timeZone' => 'America/Montreal' 
    }, 
    'recurrence' => [ 
    "RRULE:FREQ=DAILY;COUNT=5" 
    ] 
} 
0

請嘗試 「RRULE:FREQ = WEEKLY;待= 20120701T160000Z」;

+0

這是沒有問題的。這只是一個時區問題,正如api開發人員指南-_-'所示。我感覺很蠢 – flatzo 2012-01-08 17:19:06

+0

別擔心,我們都在那裏(比我想要承認的更多)。 – 2012-01-31 19:25:58