这是我使用cURL以下方法传递给 Google Calendar API 的有效负载:
["start"]=>
string(25) "2019-07-01T00:00:00+08:00"
["end"]=>
string(25) "2019-07-16T00:00:00+08:00"
["title"]=>
string(20) "Google Sync Weekly 4"
["description"]=>
string(20) "Google Sync Weekly 4"
["recurrence"]=>
string(44) "RRULE=WEEKLY;UNTIL=2019-07-16T00:00:00+08:00"
在 my 中new_event.php,我在其中处理此有效负载:
$event = new Google_Service_Calendar_Event(array(
'summary' => $event['title'],
'location' => !empty($event['location']) ? $event['location'] : '',
'description' => $event['description'],
'start' => array(
'dateTime' => $event['start'],
'timeZone' => 'Asia/Taipei',
),
'end' => array(
'dateTime' => $event['end'],
'timeZone' => 'Asia/Taipei',
),
'recurrence' => !empty($event['recurrence']) ? [$event['recurrence']] : [],
'reminders' => array(
'useDefault' => FALSE,
'overrides' => array(
array('method' => 'email', 'minutes' => 24 * 60),
array('method' => 'popup', 'minutes' => 10),
),
),
));
这是值:
["recurrence"]=>
array(1) {
[0]=>
string(44) "RRULE=WEEKLY;UNTIL=2019-07-16T00:00:00+08:00"
}
我无法弄清楚我在这里做错了什么。任何提示?
MMTTMM