當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SugarDateTime::get_day_end方法代碼示例

本文整理匯總了PHP中SugarDateTime::get_day_end方法的典型用法代碼示例。如果您正苦於以下問題:PHP SugarDateTime::get_day_end方法的具體用法?PHP SugarDateTime::get_day_end怎麽用?PHP SugarDateTime::get_day_end使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SugarDateTime的用法示例。


在下文中一共展示了SugarDateTime::get_day_end方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getAgenda

 public function getAgenda($api, $args)
 {
     // Fetch the next 14 days worth of meetings (limited to 20)
     $end_time = new SugarDateTime("+14 days");
     $start_time = new SugarDateTime("-1 hour");
     $meeting = BeanFactory::newBean('Meetings');
     $meetingList = $meeting->get_list('date_start', "date_start > " . $GLOBALS['db']->convert($GLOBALS['db']->quoted($start_time->asDb()), 'datetime') . " AND date_start < " . $GLOBALS['db']->convert($GLOBALS['db']->quoted($end_time->asDb()), 'datetime'));
     // Setup the breaks for the various time periods
     $datetime = new SugarDateTime();
     $today_stamp = $datetime->get_day_end()->getTimestamp();
     $tomorrow_stamp = $datetime->setDate($datetime->year, $datetime->month, $datetime->day + 1)->get_day_end()->getTimestamp();
     $timeDate = TimeDate::getInstance();
     $returnedMeetings = array('today' => array(), 'tomorrow' => array(), 'upcoming' => array());
     foreach ($meetingList['list'] as $meetingBean) {
         $meetingStamp = $timeDate->fromUser($meetingBean->date_start)->getTimestamp();
         $meetingData = $this->formatBean($api, $args, $meetingBean);
         if ($meetingStamp < $today_stamp) {
             $returnedMeetings['today'][] = $meetingData;
         } else {
             if ($meetingStamp < $tomorrow_stamp) {
                 $returnedMeetings['tomorrow'][] = $meetingData;
             } else {
                 $returnedMeetings['upcoming'][] = $meetingData;
             }
         }
     }
     return $returnedMeetings;
 }
開發者ID:jglaine,項目名稱:sugar761-ent,代碼行數:28,代碼來源:MeetingsApi.php

示例2: queryDay

 /**
  * Create query from the beginning to the end of certain day
  * @param array $layout_def
  * @param SugarDateTime $day
  */
 protected function queryDay($layout_def, SugarDateTime $day)
 {
     $begin = $day->get_day_begin();
     $end = $day->get_day_end();
     return $this->get_start_end_date_filter($layout_def, $begin->asDb(), $end->asDb());
 }
開發者ID:sacredwebsite,項目名稱:SuiteCRM,代碼行數:11,代碼來源:SugarWidgetFielddatetime.php


注:本文中的SugarDateTime::get_day_end方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。