【问题标题】:Google Calendar PHP Retrieve events by specified date rangeGoogle Calendar PHP 按指定日期范围检索事件
【发布时间】:2009-07-24 03:12:54
【问题描述】:

我知道您可以检索指定日期范围内的事件,但是 如何检索指定日期(一天)的事件?

我尝试将 setStartMin() 和 setStartMax 设置为同一日期, 但这不起作用。看来至少得有一天 介于最小值和最大值之间。

这是我正在使用的代码:

            $startDate='2009-07-23';
            $endDate='2009-07-23';

            $gdataCal = new Zend_Gdata_Calendar($client);
            $query = $gdataCal->newEventQuery();
            $query->setUser('default');
            $query->setVisibility('private');
            $query->setProjection('full');
            $query->setOrderby('starttime');
            $query->setStartMin($startDate);
            $query->setStartMax($endDate);
            $eventFeed = $gdataCal->getCalendarEventFeed($query);

有什么想法吗?谢谢...

编辑:

没关系,我刚刚发现:

“请注意,虽然 startMin 包含在内,但 startMax 不包含在内,因此将 startMax 指定为 '2007-08-01' 将包括 2007-07-31 11:59:59PM 之前的事件。”

【问题讨论】:

    标签: php calendar


    【解决方案1】:

    为了将此问题标记为已回答...

    虽然StartMin 包含在内,但StartMax 不包含在内,这意味着设置为StartMax 的日期不会包含在该范围内。如果要在某一天举办活动,请将StartMax 设置为第二天,如下所示:

    // Fetch all events for 2009-07-23
    $query->setStartMin('2009-07-23');
    $query->setStartMax('2009-07-24');
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-25
      • 1970-01-01
      相关资源
      最近更新 更多