Google Calendar API3 - 订购活动

时间:2012-10-01 22:54:15

标签: php google-calendar-api

我成功地从Google中提取日历和活动。但是,我正在尝试下定结果。我想今天只为今天举办活动。任何帮助都非常感谢...谢谢。

$eventsParam = array("orderBy"=>startTime, "timeMin"=>date('d-m-Y') , "timeMax"=>date('d-m-Y')); 
$eventList = $cal->events->listEvents('yoyoyo@gmail.com', $eventsParam);

    foreach($eventList->getItems() as $eventList){

        $eventsData = json_decode($eventList);
        $eventDate = explode('T', $eventList->start->dateTime);

            //Event summary
            print "<br>Summary: ";
            echo $eventList->summary;

            //Event location
            print "<br/> Location: ";
            echo $eventList->location;

            //Event date:
            print "<br/> Date: ";
            echo $eventDate[0];

            //Event time:
            print "<br/> Time: ";
            $eventTime = explode('-', $eventDate[1]);
            echo $eventTime[0];

            echo "<hr>";

    }   

1 个答案:

答案 0 :(得分:0)

使用array_filter获取今天的内容。然后,要对一组对象的属性进行排序,请考虑使用usort和您自己的比较器。我认为您的问题类似于this one