dqfxao2898 2014-12-15 03:36
浏览 30

Google PHP客户端库“全天”活动重复

Here's is my code

    if($service instanceof Google_Service_Calendar and isset($_SESSION['service_token']) and $_SESSION['service_token'] != '' ) {
                        $event = new Google_Service_Calendar_Event();
                        $event->setSummary('AllDay Event Bug');
                        $start = new Google_Service_Calendar_EventDateTime();
                        $start->setDateTime(date('Y-m-d\TH:i:s',strtotime('2015-11-11 10:00:00')));
                        $start->setTimeZone('Australia/Melbourne');
                        $event->setStart($start);
                        $end = new Google_Service_Calendar_EventDateTime();
                        $end->setDateTime(date('Y-m-d\TH:i:s',strtotime('2015-11-16 11:00:00')));
                        $end->setTimeZone('Australia/Melbourne');
                        $event->setEnd($end);
                        if(recurring) {

                            $recurrenceUntil = date('Ymd\THis\Z',strtotime('2015-11-16 11:00:00'));

                            if(count($exDateArr) > 0) {
                                $exdate = "EXDATE:".implode(",", $exDateArr);
                            } else {
                                $exdate = '';
                            }


                            switch ($repeate) {
                                case "day":
                                    $frequence = "DAILY";
                                    break;
                                case "week":
                                    $frequence = "WEEKLY";
                                    break;
                                case "month":
                                    $frequence = "MONTHLY";
                                    break;
                                case "year":
                                    $frequence = "YEARLY";
                                    break;
                            }

                            $event->setRecurrence(
                                array(
                                    "RRULE:FREQ=".$frequence.";UNTIL=".$recurrenceUntil.";INTERVAL=".$repeate_interval,
                                    $exdate
                                )
                            );

                        }

                        $newEvent = $service->events->insert('primary', $event);

}

When i search for that event in Google Calendar, this is the result i get.

Wed Nov 11, 2015   10:00am – 11:00am  AllDay Event Bug

Thu Nov 12, 2015   All day            AllDay Event Bug
                   10:00am – 11:00am  AllDay Event Bug

Fri Nov 13, 2015   All day            AllDay Event Bug
                   All day            AllDay Event Bug
                   10:00am – 11:00am  AllDay Event Bug

Sat Nov 14, 2015   All day            AllDay Event Bug
                   All day            AllDay Event Bug
                   All day            AllDay Event Bug
                   10:00am – 11:00am  AllDay Event Bug

Sun Nov 15, 2015   All day            AllDay Event Bug
                   All day            AllDay Event Bug
                   All day            AllDay Event Bug
                   All day            AllDay Event Bug
                   10:00am – 11:00am  AllDay Event Bug

Mon Nov 16, 2015   All day            AllDay Event Bug
                   All day            AllDay Event Bug
                   All day            AllDay Event Bug
                   All day            AllDay Event Bug
                   All day            AllDay Event Bug
                   10:00am – 11:00am  AllDay Event Bug

Everything is good on the first day , next day onwards an extra "All day" event is added, and it increments every day.Can anyone please tell me why this is happening ? I'm using Google Service Account Credentials and the event i've added is not a recurring one and there are no exception dates.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何在炒股软件中,爬到我想看的日k线
    • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
    • ¥15 seatunnel 怎么配置Elasticsearch
    • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
    • ¥15 (标签-MATLAB|关键词-多址)
    • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
    • ¥500 52810做蓝牙接受端
    • ¥15 基于PLC的三轴机械手程序
    • ¥15 多址通信方式的抗噪声性能和系统容量对比
    • ¥15 winform的chart曲线生成时有凸起