當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。