本文整理汇总了PHP中Formatter::formatCompleteDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Formatter::formatCompleteDate方法的具体用法?PHP Formatter::formatCompleteDate怎么用?PHP Formatter::formatCompleteDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Formatter
的用法示例。
在下文中一共展示了Formatter::formatCompleteDate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionViewSessionHistory
/**
* An AJAX called function which will return HTML containing a full history
* of a particular session, from login to logout.
* @param $id The ID of the session
*/
public function actionViewSessionHistory($id)
{
$sessions = X2Model::model('SessionLog')->findAllByAttributes(array('sessionId' => $id));
$firstTimestamp = 0;
$lastTimestamp = 0;
$str = "<table class='items'><thead><tr><th>User</th><th>Status</th><th>Timestamp</th></tr></thead>";
foreach ($sessions as $session) {
$str .= "<tr>";
$str .= "<td>" . User::getUserLinks($session->user) . "</td>";
$str .= "<td>" . SessionLog::parseStatus($session->status) . "</td>";
$str .= "<td>" . Formatter::formatCompleteDate($session->timestamp) . "</td>";
$str .= "</tr>";
}
$str .= "</table>";
echo $str;
}
示例2: renderDateTime
protected function renderDateTime($field, $makeLinks, $textOnly, $encode)
{
$fieldName = $field->fieldName;
if (empty($this->owner->{$fieldName})) {
return ' ';
} elseif (is_numeric($this->owner->{$fieldName})) {
return Formatter::formatCompleteDate($this->owner->{$fieldName});
} else {
return $this->render($this->owner->{$fieldName}, $encode);
}
}
示例3: elseif
echo "</span>";
echo "<div class='field-value'>";
echo "<span style='color:grey'>" . $model->getAttributeLabel('dueDate', true) . ':' . " </span>" . '<b>' . $model->formatDueDate() . '</b>';
echo "</div>";
if (in_array($model->type, array('event', 'time', 'call'))) {
echo "<div class='field-value'>";
echo "<span style='color:grey'>" . $model->getAttributeLabel('completeDate', true) . ':' . " </span>" . '<b>' . Formatter::formatDateTime($model->completeDate) . '</b>';
echo "</div>";
}
} elseif (!empty($model->createDate)) {
echo Yii::t('actions', 'Created:') . " " . Formatter::formatLongDateTime($model->createDate) . '</b>';
} else {
echo " ";
}
} else {
echo Yii::t('actions', 'Completed {date}', array('{date}' => Formatter::formatCompleteDate($model->completeDate)));
}
?>
</span>
<span>
<span id="controls">
<?php
if (Yii::app()->user->checkAccess('ActionsComplete', array('X2Model' => $model))) {
if ($model->complete != 'Yes') {
?>
<div class="control-button icon complete-button"
title="<?php
echo Yii::t('actions', 'Complete action');
?>
">
</div>
示例4: elseif
}
} else {
echo Formatter::formatLongDateTime($data->dueDate);
if ($data->completeDate) {
echo ' - ' . Formatter::formatLongDateTime($data->completeDate);
}
}
echo '</b>';
} elseif ($data->type == 'call') {
echo Yii::t('actions', 'Call:') . ' ' . ($data->completeDate == $data->dueDate ? Formatter::formatCompleteDate($data->completeDate) : Formatter::formatTimeInterval($data->dueDate, $data->completeDate, '{start}; {decHours} ' . Yii::t('app', 'hours')));
} elseif ($data->type == 'webactivity') {
echo Yii::t('actions', 'This contact visited your website');
} elseif ($data->type == 'time') {
echo Formatter::formatTimeInterval($data->dueDate, $data->dueDate + $data->timeSpent);
} else {
$timeFormat = Formatter::formatCompleteDate($data->getRelevantTimestamp());
if ($data->type == 'attachment') {
if ($data->completedBy === 'Email') {
$label = 'Email Message:';
} else {
$label = 'Attachment:';
}
} elseif ($data->type == 'quotes') {
$label = 'Quote:';
} elseif (in_array($data->type, array('email', 'emailFrom', 'email_quote', 'email_invoice'))) {
$label = 'Email Message:';
} elseif (in_array($data->type, array('emailOpened', 'emailOpened_quote', 'email_opened_invoice'))) {
$label = 'Email Opened:';
}
if (isset($label)) {
echo Yii::t('actions', $label) . ' ';
示例5: dynamicDate
public static function dynamicDate($date)
{
return '<span title="' . CHtml::encode(Formatter::formatCompleteDate($date)) . '">' . CHtml::encode(Formatter::formatDateDynamic($date)) . '</span>';
}