本文整理汇总了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;
}
示例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());
}