【问题标题】:Recurrence with Google calendar ruby API V3使用 Google 日历 ruby​​ API V3 重复
【发布时间】:2012-01-07 23:13:08
【问题描述】:

使用以下代码,我无法将任何重复事件推送到谷歌日历。但是,从事件中删除“重复”项目并且它可以工作。

我做错了什么?

  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' => 'hg9a7o16bm6dj0tmuo481499mc@group.calendar.google.com'},
                  :body_object => event,
                  :headers => {'Content-Type' => 'application/json'})
  puts result.data.id.to_s

【问题讨论】:

    标签: ruby google-api google-calendar-api


    【解决方案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"
      ]
    }
    

    【讨论】:

      【解决方案2】:

      请尝试使用“RRULE:FREQ=WEEKLY;UNTIL=20120701T160000Z”;

      【讨论】:

      • 这不是问题。这只是一个时区问题.. 如 api 开发人员指南 -_-' 所示。我觉得自己很蠢
      • 别担心,我们都去过那里(比我愿意承认的还要频繁)。
      猜你喜欢
      • 2015-02-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多