【问题标题】:Want to create Google Clanedar event which repeats yearly想要创建每年重复的 Google 日历活动
【发布时间】:2016-01-29 04:45:13
【问题描述】:

我成功地通过 php api 客户端将事件添加到谷歌日历,但我想要的是让该事件每年重复一次,例如公司周年纪念日等,我在谷歌文档中也没有找到,那又如何应在创建重复事件时添加

【问题讨论】:

  • 有文档,请看这里:link

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


【解决方案1】:

There is documentation for recurring event

$event = new Google_Service_Calendar_Event();
$event->setSummary('Appointment');
$event->setLocation('Somewhere');
$start = new Google_Service_Calendar_EventDateTime();
$start->setDateTime('2011-06-03T10:00:00.000-07:00');
$start->setTimeZone('America/Los_Angeles');
$event->setStart($start);
$end = new Google_Service_Calendar_EventDateTime();
$end->setDateTime('2011-06-03T10:25:00.000-07:00');
$end->setTimeZone('America/Los_Angeles');
$event->setEnd($end);
$event->setRecurrence(array('RRULE:FREQ=YEARLY;UNTIL=20110701T170000Z'));
$attendee1 = new Google_Service_Calendar_EventAttendee();
$attendee1->setEmail('attendeeEmail');
// ...
$attendees = array($attendee1,
                   // ...
                   );
$event->attendees = $attendees;
$recurringEvent = $service->events->insert('primary', $event);

echo $recurringEvent->getId();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-04-04
    • 1970-01-01
    • 2023-03-07
    • 1970-01-01
    • 2019-10-24
    • 2017-01-24
    • 1970-01-01
    • 2012-07-09
    相关资源
    最近更新 更多