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


PHP Actions::formatDate方法代码示例

本文整理汇总了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)));
     }
 }
开发者ID:netconstructor,项目名称:X2Engine,代码行数:21,代码来源:Actions.php

示例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());
    }
}
开发者ID:netconstructor,项目名称:X2Engine,代码行数:31,代码来源:_view.php


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