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


PHP CDate::getDay方法代碼示例

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


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

示例1: intval

if (!$canRead) {
    $AppUI->redirect('m=public&a=access_denied');
}
$AppUI->savePlace();
global $locale_char_set;
// retrieve any state parameters
if (isset($_REQUEST['company_id'])) {
    $AppUI->setState('CalIdxCompany', intval(w2PgetParam($_REQUEST, 'company_id', 0)));
}
$company_id = $AppUI->getState('CalIdxCompany') !== null ? $AppUI->getState('CalIdxCompany') : $AppUI->user_company;
$event_filter = $AppUI->checkPrefState('CalIdxFilter', w2PgetParam($_REQUEST, 'event_filter', ''), 'EVENTFILTER', 'my');
// get the passed timestamp (today if none)
$date = w2PgetParam($_GET, 'date', null);
// establish the focus 'date'
$this_week = new CDate($date);
$dd = $this_week->getDay();
$mm = $this_week->getMonth();
$yy = $this_week->getYear();
// prepare time period for 'events'
$first_time = new CDate(Date_calc::beginOfWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY));
$first_time->setTime(0, 0, 0);
$last_time = new CDate(Date_calc::endOfWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY));
$last_time->setTime(23, 59, 59);
$prev_week = new CDate(Date_calc::beginOfPrevWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY));
$next_week = new CDate(Date_calc::beginOfNextWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY));
$links = array();
// assemble the links for the tasks
require_once W2P_BASE_DIR . '/modules/calendar/links_tasks.php';
getTaskLinks($first_time, $last_time, $links, 50, $company_id);
// assemble the links for the events
require_once W2P_BASE_DIR . '/modules/calendar/links_events.php';
開發者ID:joly,項目名稱:web2project,代碼行數:31,代碼來源:week_view.php

示例2: intval

if (isset($_REQUEST['company_id'])) {
    $AppUI->setState('CalIdxCompany', intval($_REQUEST['company_id']));
}
$company_id = $AppUI->getState('CalIdxCompany', $AppUI->user_company);
$event_filter = $AppUI->checkPrefState('CalIdxFilter', @$_REQUEST['event_filter'], 'EVENTFILTER', 'my');
$AppUI->setState('CalDayViewTab', dPgetParam($_GET, 'tab', $tab));
$tab = $AppUI->getState('CalDayViewTab', '0');
// get the prefered date format
$df = $AppUI->getPref('SHDATEFORMAT');
// get the passed timestamp (today if none)
$ctoday = new CDate();
$today = $ctoday->format(FMT_TIMESTAMP_DATE);
$date = dPgetParam($_GET, 'date', $today);
// establish the focus 'date'
$this_day = new CDate($date);
$dd = $this_day->getDay();
$mm = $this_day->getMonth();
$yy = $this_day->getYear();
// get current week
$this_week = Date_calc::beginOfWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY);
// prepare time period for 'events'
$first_time = php4_clone($this_day);
$first_time->setTime(0, 0, 0);
$first_time->subtractSeconds(1);
$last_time = php4_clone($this_day);
$last_time->setTime(23, 59, 59);
$prev_day = new CDate(Date_calc::prevDay($dd, $mm, $yy, FMT_TIMESTAMP_DATE));
$next_day = new CDate(Date_calc::nextDay($dd, $mm, $yy, FMT_TIMESTAMP_DATE));
// setup the title block
$titleBlock = new CTitleBlock('Day View');
$titleBlock->addButton('month view', 'index.php?m=calendar&date=' . $this_day->format(FMT_TIMESTAMP_DATE));
開發者ID:n2i,項目名稱:xvnkb,代碼行數:31,代碼來源:day_view.php


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