本文整理汇总了PHP中w2p_Utilities_Date::setDay方法的典型用法代码示例。如果您正苦于以下问题:PHP w2p_Utilities_Date::setDay方法的具体用法?PHP w2p_Utilities_Date::setDay怎么用?PHP w2p_Utilities_Date::setDay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类w2p_Utilities_Date
的用法示例。
在下文中一共展示了w2p_Utilities_Date::setDay方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$minical->showWeek = false;
$minical->clickMonth = true;
$minical->setLinkFunctions('clickDay');
$first_time = new w2p_Utilities_Date($cal->prev_month);
$first_time->setDay(1);
$first_time->setTime(0, 0, 0);
$last_time = new w2p_Utilities_Date($cal->prev_month);
$last_time->setDay($cal->prev_month->getDaysInMonth());
$last_time->setTime(23, 59, 59);
$links = array();
getTaskLinks($first_time, $last_time, $links, 20, $company_id, true);
getEventLinks($first_time, $last_time, $links, 20);
$minical->setEvents($links);
echo '<table class="std" cellspacing="0" cellpadding="0" border="0" width="100%"><tr>';
echo '<td valign="top" align="center" width="220">' . $minical->show() . '</td>';
echo '<td valign="top" align="center" width="75%"> </td>';
$minical->setDate($cal->next_month);
$first_time = new w2p_Utilities_Date($cal->next_month);
$first_time->setDay(1);
$first_time->setTime(0, 0, 0);
$last_time = new w2p_Utilities_Date($cal->next_month);
$last_time->setDay($cal->next_month->getDaysInMonth());
$last_time->setTime(23, 59, 59);
$links = array();
getTaskLinks($first_time, $last_time, $links, 20, $company_id, true);
getEventLinks($first_time, $last_time, $links, 20, true);
$minical->setEvents($links);
echo '<td valign="top" align="center" width="220">' . $minical->show() . '</td>';
echo '</tr></table>';
?>
</td></tr></table>
示例2:
}
}
//set the dates for week view
// get the passed timestamp (today if none)
$date = w2PgetParam($_GET, 'date', null);
$today = new w2p_Utilities_Date();
$today = $today->format(FMT_TIMESTAMP_DATE);
// establish the focus 'date'
$this_week = new w2p_Utilities_Date($date);
$dd = $this_week->getDay();
$mm = $this_week->getMonth();
$yy = $this_week->getYear();
// prepare time period for 'events'
$first_time = new w2p_Utilities_Date(Date_Calc::beginOfWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY));
$first_time->setTime(0, 0, 0);
$first_time->setDay(1);
/*
// if Sunday is the 1st, we don't need to go back
// as that's the first day shown on the calendar
if($first_time->getDayOfWeek() != 0) {
$last_day_of_previous_month = $first_time->getPrevDay();
$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());
}
示例3: clickDay
function clickDay( uts, fdate ) {
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>
示例4: testSetDayHigh
/**
* Tests setDay with a day that is too high
*/
public function testSetDayHigh()
{
$date = new w2p_Utilities_Date('2010-11-07 11:00:00');
$date->setDay(32);
$this->assertEquals('2010-11-01 11:00:00', $date->getDate(DATE_FORMAT_ISO));
}