我成功地从 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>";
}