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


PHP w2p_Utilities_Date::setDate方法代码示例

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


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

示例1: strpos

\', \'editFrm\', \'<?php 
    echo strpos($cf, '%p') !== false ? '12' : '24';
    ?>
\', true)" >';
	htmltxt +='&nbsp;<img src="<?php 
    echo w2PfindImage('calendar.gif', $m);
    ?>
" width="24" height="12" border="0" alt="" />';
	htmltxt +='</a>';
	oCell.innerHTML =htmltxt;
	newtr.appendChild(oCell);
	oCell = document.createElement('td');
	htmltxt = '';
	//	htmltxt +='<input type='hidden' id='add_task_duration_'+line_nr+'' name='add_task_duration_'+line_nr+'' value='' />';
	htmltxt +='<input type="hidden" id="add_task_end_date_'+line_nr+'" name="add_task_end_date_'+line_nr+'" value="<?php 
    $today->setDate($today->getTime() + 60 * 60, DATE_FORMAT_UNIXTIME);
    echo $today->format(FMT_TIMESTAMP);
    ?>
" />';
	htmltxt +='<input type="text" onchange="setDate(\'editFrm\', \'end_date_'+line_nr+'\');" class="text" style="width:130px;" id="end_date_'+line_nr+'" name="end_date_'+line_nr+'" value="<?php 
    echo $today->format($cf);
    ?>
" />';
	htmltxt +='<a href="javascript: void(0);" onclick="return showCalendar(\'end_date_'+line_nr+'\', \'<?php 
    echo $cf;
    ?>
\', \'editFrm\', \'<?php 
    echo strpos($cf, '%p') !== false ? '12' : '24';
    ?>
\', true)" >';
	htmltxt +='&nbsp;<img src="<?php 
开发者ID:,项目名称:,代码行数:31,代码来源:

示例2: store

 public function store(CAppUI $AppUI)
 {
     $perms = $AppUI->acl();
     $stored = false;
     if (!$this->event_recurs) {
         $this->event_times_recuring = 0;
     } else {
         //If the event recurs then set the end date day to be equal to the start date day and keep the hour:minute of the end date
         //so that the event starts recurring from the start day onwards n times after the start date for the period given
         //Meaning: The event end date day is useless as far as recurring events are concerned.
         $start_date = new w2p_Utilities_Date($this->event_start_date);
         $end_date = new w2p_Utilities_Date($this->event_end_date);
         $hour = $end_date->getHour();
         $minute = $end_date->getMinute();
         $end_date->setDate($start_date->getDate());
         $end_date->setHour($hour);
         $end_date->setMinute($minute);
         $this->event_end_date = $end_date->format(FMT_DATETIME_MYSQL);
     }
     // ensure changes to check boxes and select lists are honoured
     $this->event_private = (int) $this->event_private;
     $this->event_type = (int) $this->event_type;
     $this->event_cwd = (int) $this->event_cwd;
     $this->_error = $this->check();
     if (count($this->_error)) {
         return $this->_error;
     }
     $this->event_start_date = $AppUI->convertToSystemTZ($this->event_start_date);
     $this->event_end_date = $AppUI->convertToSystemTZ($this->event_end_date);
     /*
      * TODO: I don't like the duplication on each of these two branches, but I
      *   don't have a good idea on how to fix it at the moment...
      */
     if ($this->event_id && $perms->checkModuleItem('events', 'edit', $this->event_id)) {
         if ($msg = parent::store()) {
             return $msg;
         }
         $stored = true;
     }
     if (0 == $this->event_id && $perms->checkModuleItem('events', 'add')) {
         if ($msg = parent::store()) {
             return $msg;
         }
         $stored = true;
     }
     if ($stored) {
         // TODO:  I *really* don't like using the POST inside here..
         $this->updateAssigned(explode(',', $_POST['event_assigned']));
         $custom_fields = new w2p_Core_CustomFields('calendar', 'addedit', $this->event_id, 'edit');
         $custom_fields->bind($_POST);
         $sql = $custom_fields->store($this->event_id);
         // Store Custom Fields
     }
     return $stored;
 }
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:55,代码来源:calendar.class.php

示例3: formatTime

function formatTime($uts)
{
    global $AppUI;
    $date = new w2p_Utilities_Date();
    $date->setDate($uts, DATE_FORMAT_UNIXTIME);
    return $date->format($AppUI->getPref('SHDATEFORMAT'));
}
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:7,代码来源:main_functions.php

示例4: hook_preStore

 protected function hook_preStore()
 {
     parent::hook_preStore();
     if (!$this->event_recurs) {
         $this->event_times_recuring = 0;
     } else {
         //If the event recurs then set the end date day to be equal to the start date day and keep the hour:minute of the end date
         //so that the event starts recurring from the start day onwards n times after the start date for the period given
         //Meaning: The event end date day is useless as far as recurring events are concerned.
         $start_date = new w2p_Utilities_Date($this->event_start_date);
         $end_date = new w2p_Utilities_Date($this->event_end_date);
         $hour = $end_date->getHour();
         $minute = $end_date->getMinute();
         $end_date->setDate($start_date->getDate());
         $end_date->setHour($hour);
         $end_date->setMinute($minute);
         $this->event_end_date = $end_date->format(FMT_DATETIME_MYSQL);
     }
     // ensure changes to check boxes and select lists are honoured
     $this->event_private = (int) $this->event_private;
     $this->event_type = (int) $this->event_type;
     $this->event_cwd = (int) $this->event_cwd;
     $this->event_creator = (int) $this->event_creator ? $this->event_creator : $this->_AppUI->user_id;
     $this->event_owner = (int) $this->event_owner ? $this->event_owner : $this->_AppUI->user_id;
     $q = $this->_getQuery();
     $this->event_updated = $q->dbfnNowWithTZ();
 }
开发者ID:illuminate3,项目名称:web2project,代码行数:27,代码来源:events.class.php

示例5: store

 public function store()
 {
     $stored = false;
     $q = $this->_getQuery();
     if (!$this->event_recurs) {
         $this->event_times_recuring = 0;
     } else {
         //If the event recurs then set the end date day to be equal to the start date day and keep the hour:minute of the end date
         //so that the event starts recurring from the start day onwards n times after the start date for the period given
         //Meaning: The event end date day is useless as far as recurring events are concerned.
         $start_date = new w2p_Utilities_Date($this->event_start_date);
         $end_date = new w2p_Utilities_Date($this->event_end_date);
         $hour = $end_date->getHour();
         $minute = $end_date->getMinute();
         $end_date->setDate($start_date->getDate());
         $end_date->setHour($hour);
         $end_date->setMinute($minute);
         $this->event_end_date = $end_date->format(FMT_DATETIME_MYSQL);
     }
     // ensure changes to check boxes and select lists are honoured
     $this->event_private = (int) $this->event_private;
     $this->event_type = (int) $this->event_type;
     $this->event_cwd = (int) $this->event_cwd;
     $this->event_start_date = $this->_AppUI->convertToSystemTZ($this->event_start_date);
     $this->event_end_date = $this->_AppUI->convertToSystemTZ($this->event_end_date);
     /*
      * TODO: I don't like the duplication on each of these two branches, but I
      *   don't have a good idea on how to fix it at the moment...
      */
     if ($this->{$this->_tbl_key} && $this->canEdit()) {
         $this->event_updated = $q->dbfnNowWithTZ();
         $stored = parent::store();
     }
     if (0 == $this->{$this->_tbl_key} && $this->canCreate()) {
         $this->event_created = $q->dbfnNowWithTZ();
         $this->event_updated = $this->event_created;
         $stored = parent::store();
     }
     return $stored;
 }
开发者ID:caseysoftware,项目名称:web2project-planner,代码行数:40,代码来源:calendar.class.php


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