【问题标题】:Recurrence rules not recognized by Google CalendarGoogle 日历无法识别重复规则
【发布时间】:2014-11-27 16:53:44
【问题描述】:

我使用 google-api-php-client-v3 将我的应用程序连接到 Google 日历并创建/删除事件。当我尝试创建重复事件时,Google 似乎无法识别 Recurrence 规则。

$event = new Google_Service_Calendar_Event();
$event->setSummary($session->summary);
$event->setLocation($session->location);
$start_date = new Zend_Date($session->date_debut . ' ' . $session->start_date);
$end_date = new Zend_Date($session->date_fin . ' ' . $session->end_date);
$start = new Google_Service_Calendar_EventDateTime();
$start->setDateTime($start_date->get(Zend_Date::RFC_3339));
$start->setTimeZone('America/Montreal');
$event->setStart($start);
$end = new Google_Service_Calendar_EventDatetime();
$end->setDateTime($end_date->get(Zend_Date::RFC_3339));
$end->setTimeZone('America/Montreal');
$event->setEnd($end);
$event->setRecurrence(array('RRULE:FREQ=DAILY;COUNT=6;INTERVAL=1;'));

在事件属性中,Repeat 属性表示:

无法在 Google 日历中编辑此重复规则。 单击取消以保留当前规则。 编辑规则并单击完成以覆盖当前规则。

在日历中直接创建的事件中,如果我应用相同的重复规则,它会被识别!

重复:每天 6 次

我错过了什么?

感谢您的帮助!

【问题讨论】:

    标签: google-calendar-api google-api-php-client


    【解决方案1】:

    此行为似乎是由尾随分号引起的。使用字符串 'RRULE:FREQ=DAILY;COUNT=6;INTERVAL=1' 可以在 Google 日历 UI 中编辑重复周期。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-14
      相关资源
      最近更新 更多