當前位置: 首頁>>代碼示例>>PHP>>正文


PHP w2p_Utilities_Date::getNextDay方法代碼示例

本文整理匯總了PHP中w2p_Utilities_Date::getNextDay方法的典型用法代碼示例。如果您正苦於以下問題:PHP w2p_Utilities_Date::getNextDay方法的具體用法?PHP w2p_Utilities_Date::getNextDay怎麽用?PHP w2p_Utilities_Date::getNextDay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在w2p_Utilities_Date的用法示例。


在下文中一共展示了w2p_Utilities_Date::getNextDay方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: remove

 public function remove(CAppUI $AppUI, w2p_Utilities_Date $date)
 {
     $perms = $AppUI->acl();
     $removed = false;
     if ($this->holiday_id && $perms->checkModuleItem('holiday', 'edit', $this->holiday_id)) {
         $holiday_start_date = new w2p_Utilities_Date($this->holiday_start_date);
         $holiday_end_date = new w2p_Utilities_Date($this->holiday_end_date);
         if ($holiday_start_date->equals($date->duplicate())) {
             if ($holiday_end_date->equals($date->duplicate())) {
                 $removed = $this->delete($AppUI);
             } else {
                 $holiday_start_date = new w2p_Utilities_Date($this->holiday_start_date);
                 $this->holiday_start_date = $holiday_start_date->getNextDay()->getDate();
                 $removed = $this->store($AppUI);
             }
         } elseif ($holiday_end_date->equals($date->duplicate())) {
             $holiday_end_date = new w2p_Utilities_Date($this->holiday_end_date);
             $this->holiday_end_date = $holiday_end_date->getPrevDay()->getDate();
             $removed = $this->store($AppUI);
         } elseif ($holiday_start_date->before($date->duplicate()) && $holiday_end_date->after($date->duplicate())) {
             $holiday_end_date = $this->holiday_end_date;
             $this->holiday_end_date = $date->getPrevDay()->getDate();
             $removed = $this->store($AppUI);
             $this->holiday_id = 0;
             // create new record
             $this->holiday_start_date = $date->getNextDay()->getDate();
             $this->holiday_end_date = $holiday_end_date;
             $removed = $this->store($AppUI);
         }
     }
     return $removed;
 }
開發者ID:Raithlin,項目名稱:web2project-holiday,代碼行數:32,代碼來源:holiday.class.php

示例2: array

    $day_of_previous_month = $last_day_of_previous_month->getDayOfWeek();
    $seconds_to_sub_in_previous_month = 86400 * $day_of_previous_month;
    // need to cast it to int because Pear::Date_Span::set down the line
    // fails to set the seconds correctly
    $last_day_of_previous_month->subtractSeconds((int) $seconds_to_sub_in_previous_month);
    $first_time->setDay($last_day_of_previous_month->getDay());
    $first_time->setMonth($last_day_of_previous_month->getMonth());
    $first_time->setYear($last_day_of_previous_month->getYear());
}
$last_time = new w2p_Utilities_Date($date);
$last_time->setDay($date->getDaysInMonth());
$last_time->setTime(23, 59, 59);
// if Saturday is the last day of month, we don't need to go forward
// as that's the last day shown on the calendar
if ($last_time->getDayOfWeek() != 6) {
    $first_day_of_next_month = $last_time->getNextDay();
    $day_of_next_month = $first_day_of_next_month->getDayOfWeek();
    $seconds_to_add_in_next_month = 86400 * $day_of_next_month;
    // need to cast it to int because Pear::Date_Span::set down the line
    // fails to set the seconds correctly
    $first_day_of_next_month->addSeconds((int) $seconds_to_add_in_next_month);
    $last_time->setDay($first_day_of_next_month->getDay());
    $last_time->setMonth($first_day_of_next_month->getMonth());
    $last_time->setYear($first_day_of_next_month->getYear());
}
$links = array();
// assemble the links for the tasks
require_once W2P_BASE_DIR . '/modules/calendar/links_tasks.php';
getTaskLinks($first_time, $last_time, $links, 20, $company_id);
// assemble the links for the events
require_once W2P_BASE_DIR . '/modules/calendar/links_events.php';
開發者ID:viniciusbudines,項目名稱:sisnuss,代碼行數:31,代碼來源:index.php


注:本文中的w2p_Utilities_Date::getNextDay方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。