本文整理汇总了PHP中CakeTime::isToday方法的典型用法代码示例。如果您正苦于以下问题:PHP CakeTime::isToday方法的具体用法?PHP CakeTime::isToday怎么用?PHP CakeTime::isToday使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CakeTime
的用法示例。
在下文中一共展示了CakeTime::isToday方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: follow_expedient
/**
* index method
*
* @return void
*/
public function follow_expedient($idE = null)
{
App::uses('CakeTime', 'Utility');
$confirmas = $this->Confirma->Expediente->find('all', array('conditions' => array('Expediente.user_id' => $idE)));
if (isset($confirmas[0]['Expediente']['previsao_chegada']) && !empty($confirmas[0]['Expediente']['previsao_chegada'])) {
if (CakeTime::isToday($confirmas[0]['Expediente']['previsao_chegada'])) {
/* greet user with a happy birthday message
Enviar um email alertando sobre a data quase vencida.
*/
$vence_hoje = 'Chega Hoje';
if (isset($vence_hoje) && empty($vence_hoje)) {
$vence_hoje = '';
}
$this->set('vence_hoje', $vence_hoje);
}
}
$this->set(compact('confirmas', 'idE'));
}
示例2: days
/**
* Days in theme
* @param int $theme_id
*/
public function days($theme_id = null, $user_id = null)
{
if (!$theme_id) {
return;
}
$options = array('recursive' => -1, 'conditions' => array('Day.theme_id' => $theme_id), 'order' => array('data ASC'));
$rows = $this->Day->find('all', $options);
foreach ($rows as $key => $row) {
$row['Day']['isFuture'] = false;
$row['Day']['isPast'] = false;
$row['Day']['isToday'] = false;
$row['Day']['comments'] = $this->Comment->find('count', array('conditions' => array('Comment.user_id' => !$this->isUser() ? $user_id : $this->getUserId(), 'Comment.day_id' => $row['Day']['id'])));
if (CakeTime::isFuture($row['Day']['data'])) {
$row['Day']['isFuture'] = true;
}
if (CakeTime::isPast($row['Day']['data'])) {
$row['Day']['isPast'] = true;
}
if (CakeTime::isToday($row['Day']['data'])) {
$row['Day']['isToday'] = true;
}
$data[] = $row['Day'];
}
$this->set($data);
$this->set('_serialize', array_keys($data));
}
示例3: isToday
/**
* Returns true if given datetime string is today.
*
* @param int|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
*
* @return bool True if datetime string is today
* @see CakeTime::isToday()
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
*/
public function isToday($dateString, $timezone = NULL)
{
return $this->_engine->isToday($dateString, $timezone);
}