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


PHP w2p_Utilities_Date::setMonth方法代码示例

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


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

示例1: array

    $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';
getEventLinks($first_time, $last_time, $links, 20);
$moduleList = $AppUI->getLoadableModuleList();
foreach ($moduleList as $module) {
    if (!in_array($module['mod_main_class'], get_declared_classes())) {
        require_once $AppUI->getModuleClass($module['mod_directory']);
    }
    $object = new $module['mod_main_class']();
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:index.php

示例2: clickDay

 *	@param string Formatted date
 */
	function clickDay( idate, fdate ) {
		window.opener.<?php 
echo $callback;
?>
(idate,fdate);
		window.close();
	}
</script>
<table border="0" cellspacing="0" cellpadding="3" width="100%">
	<tr>
<?php 
$s = '';
for ($i = 0; $i < 12; $i++) {
    $this_month->setMonth($i + 1);
    $s .= '<td width="8%"><a href="index.php?m=public&a=calendar&dialog=1&callback=' . $callback . '&date=' . $this_month->format(FMT_TIMESTAMP_DATE) . '&uts=' . $prev_date . '" class="">' . substr($this_month->format('%b'), 0, 1) . '</a></td>';
}
echo $s;
?>
	</tr>
	<tr>
<?php 
echo '<td colspan="6" align="left">';
echo "<a href=\"index.php?m=public&a=calendar&dialog=1&callback={$callback}&date=" . $cal->prev_year->format(FMT_TIMESTAMP_DATE) . "&uts={$prev_date}\" class=\"\">" . $cal->prev_year->getYear() . '</a>';
echo '</td><td colspan="6" align="right">';
echo "<a href=\"index.php?m=public&a=calendar&dialog=1&callback={$callback}&date=" . $cal->next_year->format(FMT_TIMESTAMP_DATE) . "&uts={$prev_date}\" class=\"\">" . $cal->next_year->getYear() . '</a>';
echo '</td>';
?>
	</tr>
</table>
开发者ID:eureka2,项目名称:web2project,代码行数:31,代码来源:calendar.php

示例3: clickWeek

	window.location = './index.php?m=events&a=day_view&date='+uts;
}
function clickWeek( uts, fdate ) {
	window.location = './index.php?m=events&a=week_view&date='+uts;
}
</script>

<?php 
// establish the focus 'date'
if (!$date) {
    $date = new w2p_Utilities_Date();
} else {
    $date = new w2p_Utilities_Date($date);
}
$date->setDay(1);
$date->setMonth(1);
$prev_year = $date->format(FMT_TIMESTAMP_DATE);
$prev_year = (int) ($prev_year - 10000);
$next_year = $date->format(FMT_TIMESTAMP_DATE);
$next_year = (int) ($next_year + 10000);
?>
<table class="std view">
	<tr>
		<td align="center">
			<table width="100%" cellspacing="0" cellpadding="4">
				<tr>
					<td colspan="20" valign="top">
				    	<table border="0" cellspacing="1" cellpadding="2" width="100%" class="motitle">
				        	<tr>
				            	<td>
				                	<a href="<?php 
开发者ID:victorrod,项目名称:web2project,代码行数:31,代码来源:year_view.php

示例4: testSetMonthHigh

 /**
  * Tests setMonth with month that is above 12
  */
 public function testSetMonthHigh()
 {
     $date = new w2p_Utilities_Date('2010-11-07 11:00:00');
     $date->setMonth(14);
     $this->assertEquals('2010-01-07 11:00:00', $date->getDate(DATE_FORMAT_ISO));
 }
开发者ID:eureka2,项目名称:web2project,代码行数:9,代码来源:date.test.php


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