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


PHP w2p_Utilities_Date::calcFinish方法代码示例

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


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

示例1: calcFinish

function calcFinish($start_date, $start_hour, $start_minute, $duration_type, $task_duration)
{
    global $AppUI;
    $df = $AppUI->getPref('SHDATEFORMAT');
    $year = substr($start_date, 0, 4);
    $month = substr($start_date, 4, 2);
    $day = substr($start_date, 6, 2);
    $date = new w2p_Utilities_Date($year . '-' . $month . '-' . $day);
    $date->setTime($start_hour, $start_minute);
    $finish = $date->calcFinish($task_duration, $duration_type);
    $response = new xajaxResponse();
    $response->assign('end_date', 'value', $finish->format($df));
    $response->assign('task_end_date', 'value', $finish->format(FMT_TIMESTAMP_DATE));
    $response->assign('end_hour', 'value', $finish->getHour());
    $response->assign('end_minute', 'value', $finish->getMinute());
    if ($finish->getHour() > 11) {
        $response->assign('end_hour_ampm', 'value', 'pm');
    } else {
        $response->assign('end_hour_ampm', 'value', 'am');
    }
    return $response;
}
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:22,代码来源:ajax_functions.php

示例2: testCalcFinishAddDaysDayDurationAcrossNonWorkingDays

 /**
  * Test calcFinish with day duration across non working days
  */
 public function testCalcFinishAddDaysDayDurationAcrossNonWorkingDays()
 {
     $date = new w2p_Utilities_Date('2010-09-17 10:00:00');
     $finish = $date->calcFinish(2, 24);
     $this->assertEquals('2010-09-21 10:00:00', $finish->getDate(DATE_FORMAT_ISO));
 }
开发者ID:eureka2,项目名称:web2project,代码行数:9,代码来源:date.test.php

示例3: array

        //User time format in 12hr
        $hours[$current_key] = $current > 12 ? $current - 12 : $current;
    } else {
        //User time format in 24hr
        $hours[$current_key] = $current;
    }
}
$minutes = array();
$minutes['00'] = '00';
for ($current = $inc; $current < 60; $current += $inc) {
    $minutes[$current] = $current;
}
// format dates
$df = $AppUI->getPref('SHDATEFORMAT');
$defaultDate = new w2p_Utilities_Date();
$start_date = intval($object->task_start_date) ? new w2p_Utilities_Date($AppUI->formatTZAwareTime($object->task_start_date, '%Y-%m-%d %T')) : $defaultDate->calcFinish(1, $object->task_duration_type);
$object->task_duration = isset($object->task_duration) ? $object->task_duration : 1;
$end_date = intval($object->task_end_date) ? new w2p_Utilities_Date($AppUI->formatTZAwareTime($object->task_end_date, '%Y-%m-%d %T')) : $defaultDate->calcFinish($object->task_duration + 1, $object->task_duration_type);
// convert the numeric calendar_working_days config array value to a human readable output format
$cwd = explode(',', $w2Pconfig['cal_working_days']);
$cwd_conv = array_map('cal_work_day_conv', $cwd);
$cwd_hr = implode(', ', $cwd_conv);
include $AppUI->getTheme()->resolveTemplate('tasks/addedit_dates');
?>
<script language="javascript">
	subForm.push(new FormDefinition(<?php 
echo $tab;
?>
, document.datesFrm, checkDates, saveDates));
</script>
开发者ID:illuminate3,项目名称:web2project,代码行数:30,代码来源:ae_dates.php


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