使用开始时间和结束时间请求 Google 日历事件
Request Google Calendar event using start time and end time
我们能否添加日期时间过滤器以从 google 日历
中获取事件
require_once '../../src/Google_Client.php';
require_once '../../src/contrib/Google_CalendarService.php';
$client = new Google_Client();
$client->setApplicationName("xxxx");
$client->setClientId('xxxxxxx');
$client->setClientSecret('1Z1Wd1M18yF3LXMVVPqoZA9S');
$client->setRedirectUri('xxxxxx');
$client->setDeveloperKey('<key>');
$cal = new Google_CalendarService($client);
$events = $cal->events->listEvents('<calender_id>');
var_dump($events);
Google日历APIEvents: list有两个选项
timeMax
Upper bound (exclusive) for an event's start time to
filter by. Optional. The default is not to filter by start time. Must
be an RFC3339 timestamp with mandatory time zone offset, e.g.,
2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be
provided but will be ignored.
timeMin
Lower bound
(inclusive) for an event's end time to filter by. Optional. The
default is not to filter by end time. Must be an RFC3339 timestamp
with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00,
2011-06-03T10:00:00Z. Milliseconds may be provided but will be
ignored.
通过发送这些您应该能够限制您的结果。
我们能否添加日期时间过滤器以从 google 日历
中获取事件require_once '../../src/Google_Client.php';
require_once '../../src/contrib/Google_CalendarService.php';
$client = new Google_Client();
$client->setApplicationName("xxxx");
$client->setClientId('xxxxxxx');
$client->setClientSecret('1Z1Wd1M18yF3LXMVVPqoZA9S');
$client->setRedirectUri('xxxxxx');
$client->setDeveloperKey('<key>');
$cal = new Google_CalendarService($client);
$events = $cal->events->listEvents('<calender_id>');
var_dump($events);
Google日历APIEvents: list有两个选项
timeMax
Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored.
timeMin
Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored.
通过发送这些您应该能够限制您的结果。