duang8642 2016-02-03 11:34 采纳率: 0%
浏览 32

我不能在谷歌日历api请求上设置sigleEvents标志

Im implementing a calendar on my project using the google api to retrieve data and then render it into my js plugin, and it works fin but with the recurrent events. im trying to set the singleEvents flag en my request to retrieve the recurrent event instances instead the recurrent event itself, but is not working.

my code:

foreach($cals as $cal){
                $optParam = array(
                    'singleEvents' => TRUE
                );
                $events = $service->events->listEvents($cal->id, $optParam);
                while(true) {
                    $eventArray = array();
                    foreach ($events->getItems() as $event) {
                        if($event->getStatus != 'cancelled'){
                            {RETRIEVE DATA}
                        }
                    }
                    $pageToken = $events->getNextPageToken();
                    if ($pageToken) {
                        $optParams = array(
                            'pageToken' => $pageToken
                        );
                        $events = $service->events->listEvents($cal->id, $optParams);
                    } else {
                        break;
                    }
                }

Any suggestions will be welcome.

  • 写回答

1条回答 默认 最新

  • dongsui8162 2016-02-04 17:17
    关注

    You may try to set the 'singleEvents' flag to true when calling the 'Events:list'

    Based on the Official Google Documentation, whether to expand recurring events into instances and only return single one-off events and instances of recurring events but not underlying recurring events themselves. The default is False.

    For your reference, click here: https://developers.google.com/google-apps/calendar/v3/reference/events/list

    评论

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探