当前位置: 首页>>代码示例>>PHP>>正文


PHP DateHelper::getRelativeDate方法代码示例

本文整理汇总了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>';
开发者ID:houzhenggang,项目名称:cobalt,代码行数:31,代码来源:event_listings.php

示例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 
开发者ID:houzhenggang,项目名称:cobalt,代码行数:31,代码来源:default.mobile.php


注:本文中的DateHelper::getRelativeDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。