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


PHP helper::diffDate方法代码示例

本文整理汇总了PHP中helper::diffDate方法的典型用法代码示例。如果您正苦于以下问题:PHP helper::diffDate方法的具体用法?PHP helper::diffDate怎么用?PHP helper::diffDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在helper的用法示例。


在下文中一共展示了helper::diffDate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processBurnData

 /**
  * Process burndown datas when the sets is smaller than the itemCounts.
  * 
  * @param  array   $sets 
  * @param  int     $itemCounts 
  * @param  date    $begin 
  * @param  date    $end 
  * @param  string  $mode 
  * @access public
  * @return array
  */
 public function processBurnData($sets, $itemCounts, $begin, $end, $mode = 'noempty')
 {
     $burnCounts = count($sets);
     $current = helper::today();
     if ($end != '0000-00-00') {
         $period = helper::diffDate($end, $begin) + 1;
         $counts = $period > $itemCounts ? $itemCounts : $period;
     } else {
         $counts = $itemCounts;
     }
     for ($i = 0; $i < $counts - $burnCounts; $i++) {
         if (helper::diffDate($current, $end) > 0) {
             break;
         }
         if (!isset($sets[$current]) and $mode != 'noempty') {
             $sets[$current]->name = $current;
             $sets[$current]->value = '';
         }
         $nextDay = date(DT_DATE1, strtotime('next day', strtotime($current)));
         $current = $nextDay;
     }
     return $sets;
 }
开发者ID:nanata1115,项目名称:zentaopms,代码行数:34,代码来源:model.php

示例2: foreach

</th>
        <th class='w-status'><?php 
echo $lang->statusAB;
?>
</th>
      </tr>
      </thead>
      <tbody>
      <?php 
foreach ($allBugs as $bug) {
    ?>
      <?php 
    if (isset($planBugs[$bug->id])) {
        continue;
    }
    if ($bug->plan and helper::diffDate($plans[$bug->plan], helper::today()) > 0) {
        continue;
    }
    ?>
      <tr>
        <td class='text-left'>
          <input class='ml-10px' type='checkbox' name='bugs[]'  value='<?php 
    echo $bug->id;
    ?>
'/> 
          <?php 
    echo html::a($this->createLink('bug', 'view', "bugID={$bug->id}"), $bug->id);
    ?>
        </td>
        <td><span class='<?php 
    echo 'pri' . zget($lang->bug->priList, $bug->pri, $bug->pri);
开发者ID:heeeello,项目名称:zentaopms,代码行数:31,代码来源:linkbug.html.php

示例3: workload

 /**
  * Workload report.
  * 
  * @access public
  * @return void
  */
 public function workload($begin = '', $end = '', $days = 0, $workday = 7, $dept = 0)
 {
     if ($_POST) {
         $data = fixer::input('post')->get();
         $begin = $data->begin;
         $end = $data->end;
         $dept = $data->dept;
         $days = $data->days;
         $workday = $data->workday;
     }
     $begin = $begin ? date('Y-m-d', strtotime($begin)) : date('Y-m-d', strtotime('now'));
     $end = $end ? date('Y-m-d', strtotime($end)) : date('Y-m-d', strtotime('+1 week'));
     if (!$days) {
         $diffDays = helper::diffDate($end, $begin);
         $days = round($diffDays - $diffDays / 7 * 2);
     }
     $this->view->title = $this->lang->report->workload;
     $this->view->position[] = $this->lang->report->workload;
     $this->view->workload = $this->report->getWorkload($dept);
     $this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed|nodeleted');
     $this->view->depts = $this->loadModel('dept')->getOptionMenu();
     $this->view->begin = $begin;
     $this->view->end = $end;
     $this->view->days = $days;
     $this->view->workday = $workday;
     $this->view->dept = $dept;
     $this->view->allHour = $days * $workday;
     $this->view->submenu = 'staff';
     $this->display();
 }
开发者ID:caiwenhao,项目名称:zentao,代码行数:36,代码来源:control.php

示例4: processTask

 /**
  * Process a task, judge it's status.
  * 
  * @param  object    $task 
  * @access private
  * @return object
  */
 public function processTask($task)
 {
     $today = helper::today();
     /* Delayed or not?. */
     if ($task->status !== 'done' and $task->status !== 'cancel' and $task->status != 'closed') {
         if ($task->deadline != '0000-00-00') {
             $delay = helper::diffDate($today, $task->deadline);
             if ($delay > 0) {
                 $task->delay = $delay;
             }
         }
     }
     /* Story changed or not. */
     $task->needConfirm = false;
     if ($task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion) {
         $task->needConfirm = true;
     }
     return $task;
 }
开发者ID:laiello,项目名称:zentaoms,代码行数:26,代码来源:model.php

示例5: foreach

</th>
      <th class='w-60px'>  <?php 
echo $lang->story->stageAB;
?>
</th>
    </tr>
    </thead>
    <tbody>
    <?php 
foreach ($allStories as $story) {
    ?>
    <?php 
    if (isset($planStories[$story->id])) {
        continue;
    }
    if ($story->plan and helper::diffDate($plans[$story->plan], helper::today()) > 0) {
        continue;
    }
    ?>
    <tr>
      <td class='a-left'>
        <input class='ml-10px' type='checkbox' name='stories[]'  value='<?php 
    echo $story->id;
    ?>
'/> 
        <?php 
    echo html::a($this->createLink('story', 'view', "storyID={$story->id}"), $story->id);
    ?>
      </td>
      <td><span class='<?php 
    echo 'pri' . $story->pri;
开发者ID:laiello,项目名称:zentaoms,代码行数:31,代码来源:linkstory.html.php

示例6: getBurnDataFlot

 /**
  * Get burn data for flot 
  * 
  * @param  int    $projectID 
  * @param  int    $itemCounts 
  * @access public
  * @return void
  */
 public function getBurnDataFlot($projectID = 0, $itemCounts = 30)
 {
     /* Get project and burn counts. */
     $project = $this->getById($projectID);
     $burnCounts = $this->dao->select('count(*) AS counts')->from(TABLE_BURN)->where('project')->eq($projectID)->fetch('counts');
     /* If the burnCounts > $itemCounts, get the latest $itemCounts records. */
     $sql = $this->dao->select('date AS name, `left` AS value')->from(TABLE_BURN)->where('project')->eq((int) $projectID);
     if ($burnCounts > $itemCounts) {
         $sets = $sql->orderBy('date DESC')->limit($itemCounts)->fetchAll('name');
         $sets = array_reverse($sets);
     } else {
         /* The burnCounts < itemCounts, after getting from the db, padding left dates. */
         $sets = $sql->orderBy('date ASC')->fetchAll('name');
         $current = helper::today();
         if ($project->end != '0000-00-00') {
             $period = helper::diffDate($project->end, $project->begin) + 1;
             $counts = $period > $itemCounts ? $itemCounts : $period;
         } else {
             $counts = $itemCounts;
         }
         for ($i = 0; $i < $counts - $burnCounts; $i++) {
             if (helper::diffDate($current, $project->end) > 0) {
                 break;
             }
             if (!isset($sets[$current])) {
                 $sets[$current]->name = $current;
                 $sets[$current]->value = '';
             }
             $nextDay = date(DT_DATE1, strtotime('next day', strtotime($current)));
             $current = $nextDay;
         }
     }
     $count = 0;
     foreach ($sets as $set) {
         $set->name = (string) strtotime("{$set->name} UTC") . '000';
         $count++;
     }
     $sets['count'] = $count;
     return $sets;
 }
开发者ID:shshenpengfei,项目名称:scrum_project_manage_system,代码行数:48,代码来源:model.php

示例7: date

<?php

$properties = $this->loadModel('api')->getLicenses();
$html = '';
if ($properties['expireDate'] != 'All Life') {
    $expireDays = helper::diffDate($properties['expireDate'], date('Y-m-d'));
    if ($expireDays <= 7 and $expireDays >= 0) {
        $html = sprintf($lang->user->expireWaring, $expireDays);
    }
}
?>
<script>
$(function()
{
    $('#poweredby').append(<?php 
echo json_encode($html);
?>
);
})
</script>
开发者ID:xupnge1314,项目名称:project,代码行数:20,代码来源:login.bizext.html.hook.php

示例8: processInfo

 private function processInfo($info)
 {
     $today = helper::today();
     /* Delayed or not?. */
     if ($info->deadline != '0000-00-00') {
         $delay = helper::diffDate($today, $info->deadline);
         if ($delay > 0) {
             $info->delay = $delay;
         }
     }
     return $info;
 }
开发者ID:huokedu,项目名称:zentao,代码行数:12,代码来源:model.php


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