本文整理汇总了PHP中Actions::formatDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Actions::formatDate方法的具体用法?PHP Actions::formatDate怎么用?PHP Actions::formatDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Actions
的用法示例。
在下文中一共展示了Actions::formatDate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseStatus
public static function parseStatus($dueDate)
{
if (empty($dueDate)) {
// there is no due date
return false;
}
if (!is_numeric($dueDate)) {
$dueDate = strtotime($dueDate);
}
// make sure $date is a proper timestamp
//$due = getDate($dueDate);
//$dueDate = mktime(23,59,59,$due['mon'],$due['mday'],$due['year']); // if there is no time, give them until 11:59 PM to finish the action
//$dueDate += 86399;
$timeLeft = $dueDate - time();
// calculate how long till due date
if ($timeLeft < 0) {
return Yii::t('actions', 'Overdue {time}', array('{time}' => Actions::formatDate($dueDate)));
} else {
return Yii::t('actions', 'Due {date}', array('{date}' => Actions::formatDate($dueDate)));
}
}
示例2: elseif
} else {
echo Yii::t('actions', 'Attachment:') . ' ' . Actions::formatDate($data->completeDate);
}
//User::getUserLinks($data->completedBy);
echo ' ';
//if ($data->complete=='Yes')
//echo Actions::formatDate($data->completeDate);
//else
//echo Actions::parseStatus($data->dueDate);
} elseif ($data->type == 'workflow') {
// $actionData = explode(':',$data->actionDescription);
$workflowRecord = CActiveRecord::model('Workflow')->findByPk($data->workflowId);
$stageRecords = CActiveRecord::model('WorkflowStage')->findAllByAttributes(array('workflowId' => $data->workflowId), new CDbCriteria(array('order' => 'id ASC')));
echo Yii::t('workflow', 'Workflow:') . '<b> ' . $workflowRecord->name . '/' . $stageRecords[$data->stageNumber - 1]->name . '</b> ';
} elseif ($data->type == 'email') {
echo Yii::t('actions', 'Email Message:') . ' ' . Actions::formatDate($data->completeDate);
} elseif ($data->type == 'note') {
echo Yii::app()->dateFormatter->format(Yii::app()->locale->getDateFormat("medium"), $data->completeDate);
} elseif ($data->type == 'call' || $data->type) {
echo Yii::t('actions', 'Call:') . ' ' . Yii::app()->dateFormatter->format(Yii::app()->locale->getDateFormat("medium"), $data->completeDate);
}
?>
<div class="buttons">
<?php
if (empty($data->type)) {
if ($data->complete == 'Yes') {
echo CHtml::link('[' . Yii::t('actions', 'Uncomplete') . ']', array('/actions/default/uncomplete', 'id' => $data->id, 'redirect' => 1), array());
} else {
echo CHtml::link('[' . Yii::t('actions', 'Complete') . ']', array('/actions/default/complete', 'id' => $data->id, 'redirect' => 1), array());
}
}