【问题标题】:Request Google Calendar event using start time and end time使用开始时间和结束时间请求 Google 日历活动
【发布时间】:2016-05-03 19:33:05
【问题描述】:

我们可以添加日期时间过滤器以从谷歌日历中获取事件

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);

【问题讨论】:

  • 你试过使用timeMin和timeMax吗?

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


【解决方案1】:

Google Calendar API Events: list 有两个选项

timeMax
事件开始时间的上限(不包括) 过滤。可选的。默认不按开始时间过滤。必须 是具有强制性时区偏移量的 RFC3339 时间戳,例如, 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z。毫秒可能是 提供但将被忽略。
timeMin
下限 (含)过滤事件的结束时间。可选的。这 默认不按结束时间过滤。必须是 RFC3339 时间戳 具有强制性时区偏移量,例如 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z。可能会提供毫秒,但会 忽略。

通过发送这些您应该能够限制您的结果。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多