本文整理汇总了PHP中DateHelper::getRelativeDate方法的典型用法代码示例。如果您正苦于以下问题:PHP DateHelper::getRelativeDate方法的具体用法?PHP DateHelper::getRelativeDate怎么用?PHP DateHelper::getRelativeDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateHelper
的用法示例。
在下文中一共展示了DateHelper::getRelativeDate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Copyright
# Cobalt
# ------------------------------------------------------------------------
# @author Cobalt
# @copyright Copyright (C) 2012 cobaltcrm.org All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Website: http://www.cobaltcrm.org
-------------------------------------------------------------------------*/
// no direct access
defined('_CEXEC') or die('Restricted access');
$current_heading = "";
if (count($this->events) > 0) {
foreach ($this->events as $event) {
$display_date = $event['type'] == "event" ? $event['start_time'] . " " . $event['start_time_hour'] : $event['due_date'] . " " . $event['due_date_hour'];
$time = $event['type'] == "event" ? $event['start_time_hour'] : $event['due_date_hour'];
$display_date = $display_date == "" ? TextHelper::_('COBALT_NA') : DateHelper::formatDate($display_date, false, false);
$relative_date_title = DateHelper::getRelativeDate($display_date);
if ($event['completed'] == 1) {
$completed = "line-through";
} else {
$completed = "";
}
if ($current_heading != $relative_date_title) {
if ($current_heading != "") {
echo '</table>';
}
echo '<h4>' . $relative_date_title . '</h4>';
$current_heading = $relative_date_title;
echo '<table class="table table-striped table-hover">';
}
echo '<tr class="com_crmery_task_event" id="com_crmery_listing_' . $event['id'] . '">';
echo '<td><input type="checkbox" class="event_list_checkbox" name="item_id[' . $event['id'] . ']" /></td>';
示例2: ucwords
<?php
echo ucwords(TextHelper::_('COBALT_ADD_TASK'));
?>
</a>
</div>
<div data-role="content">
<ul class="ui-listview" data-role="listview" data-filter="true" data-autodividers="true" data-theme="c">
<?php
$n = count($this->events);
for ($i = 0; $i < $n; $i++) {
$event = $this->events[$i];
$event_date = DateHelper::formatDate($event['due_date']);
$k = $i % 2;
if ($i == 0 || substr_compare($event['due_date'], $this->events[$i - 1]['due_date'], 0)) {
echo "<li data-role='list-divider'>" . DateHelper::getRelativeDate($event_date) . " " . $event_date . "</li>";
}
?>
<li data-filtertext="<?php
echo $event['name'];
?>
">
<a href="<?php
echo RouteHelper::_('index.php?view=events&layout=event&id=' . $event['id']);
?>
">
<h3 class="ui-li-heading"><?php
echo $event['name'];
?>
</h3>
<p class="ui-li-desc"><?php