问题描述
使用PHP客户端库,我试图创建一个每周定期发生的事件,该事件将在我们停业后的几天跳过.
Using the PHP Client Library, I'm trying to create a weekly recurring event that will skip on days when we are closed for business.
我正在传递这些参数以创建一个新的Google_Service_Calendar_Event对象,该对象将传递给Google_Service_Calendar :: events-> update().
I'm passing these parameters to make a new Google_Service_Calendar_Event object that gets passed to Google_Service_Calendar::events->update().
$params = array(
'summary' => 'Event Title',
'location' => 'Event Location',
'start' => array(
'dateTime' => $slot['startDate'].'T'.$slot['startTime'],
'timeZone' => 'America/New_York',
),
'end' => array(
'dateTime' => $slot['startDate'].'T'.$slot['endTime'],
'timeZone' => 'America/New_York',
),
'recurrence' => $arrRecurrence,
'attendees' => $arrAttendees,
);
$arrRecurrence
的规则规定,该活动应每周重复,直到2月底,跳过总统日":
$arrRecurrence
has rules dictating that the event should repeat weekly until the end of February, skipping Presidents' Day:
Array
(
[0] => EXDATE;VALUE=DATE:20180219
[1] => RRULE:FREQ=WEEKLY;UNTIL=20180224;BYDAY=MO
)
RRULE
的应用正确,但是EXDATE
被忽略了,我似乎无法弄清楚为什么.
The RRULE
is being applied correctly, but the EXDATE
is being ignored and I can't seem to figure out why.
推荐答案
EXDATE的格式必须与开始和结束的值相同.在这种情况下,这意味着EXDATE需要一个附加的时间分量和一个时区.
EXDATE must be in the same format as the values for start and end. In this case, that means EXDATE needs an additional time component, and a timezone.
EXDATE;TZID=America/New_York;VALUE=DATE:20180219T000000Z
这篇关于EXDATE重复设置被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!