本文整理汇总了PHP中Calendar::getMonth方法的典型用法代码示例。如果您正苦于以下问题:PHP Calendar::getMonth方法的具体用法?PHP Calendar::getMonth怎么用?PHP Calendar::getMonth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Calendar
的用法示例。
在下文中一共展示了Calendar::getMonth方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetter
public function testGetter()
{
$calendar = new Calendar(new \DateTime('2014-01-01 12:14:00'), new \DateTimeZone('UTC'));
$this->assertEquals('2014-01-01 00:00:00', $calendar->getDate()->format('Y-m-d H:i:s'));
$calendar->setDate(new \DateTime('2014-01-04 12:14:00'));
$this->assertEquals('2014-01-04 00:00:00', $calendar->getDate()->format('Y-m-d H:i:s'));
$tz = new \DateTimeZone('Europe/Berlin');
$calendar->setTimezone($tz);
$this->assertEquals($tz, $calendar->getTimezone());
$this->assertEquals('01', $calendar->getWeekNumber());
$this->assertEquals(4, $calendar->getDay());
$this->assertEquals(1, $calendar->getMonth());
$this->assertEquals(2014, $calendar->getYear());
$this->assertEquals('January', $calendar->getMonthName());
}
示例2: Calendar
* The following code is used to create the calendar. The calendar class
* which creates it must be instantiated before the html template is included.
* This helps ensure that we are able to control the calendar and the way it
* operates independently based on each page. We instantiate a different
* Calendar class depending on a supply of page parameter or not
*/
//Instantiate the Calendar Class
if (!empty($_GET["m"]) && !empty($_GET["y"])) {
$Calendar = new Calendar($_GET["m"], $_GET["y"]);
} else {
$Calendar = new Calendar(date('m'), date('Y'));
}
//Variables for the calender
$empty = $Calendar->getEmpty();
//The number of empty boxes at start of the month
$month = $Calendar->getMonth();
//The numeric representation of the month
$year = $Calendar->getYear();
//The numeric representation of the year
$total = $Calendar->getTotal();
//The total number of days for the specified month
$feed = $Feed->getPublicFeed($month, $year);
?>
<div id="calendar-scroller" style="position:absolute;right:0;">
<div class="calendar-wrapper">
<div class="top-heading">Public Calendar</div>
<div class="date">
<h2>
<!--Decrement the month-->
<?php
示例3:
<td class='value'><?php
echo $cal->getTime();
?>
</td>
</tr>
<tr>
<td class='name'>current day of month</td>
<td class='value'><?php
echo $cal->getDay();
?>
</td>
</tr>
<tr>
<td class='name'>current month</td>
<td class='value'><?php
echo $cal->getMonth();
?>
</td>
</tr>
<tr>
<td class='name'>current year</td>
<td class='value'><?php
echo $cal->getYear();
?>
</td>
</tr>
<tr>
<td class='name'>current year is a leap year ?</td>
<td class='value'><?php
echo $cal->isLeapYear() ? 'Yes' : 'No';
?>
示例4: array
}
</style>
<div class="row form-group">
<div class="col-sm-1 col-xs-1 color-grey">
<?php
echo CHtml::link('<span class="icon-double-angle-left"></span>', $preUrl);
?>
</div>
<div class="col-sm-3 col-xs-3">
<?php
echo CHtml::dropDownList('yueban_year', $yearnow, Calendar::getYear(), array('class' => 'form-control', 'empty' => '--年份--', 'onchange' => "yueRe()"));
?>
</div>
<div class="col-sm-3 col-xs-3">
<?php
echo CHtml::dropDownList('yueban_month', $monthnow, Calendar::getMonth(), array('class' => 'form-control', 'empty' => '--月份--', 'onchange' => "yueRe()"));
?>
</div>
<div class="col-sm-1 col-xs-1 color-grey">
<?php
echo CHtml::link('<span class="icon-double-angle-right"></span>', $nextUrl);
?>
</div>
<div class="col-sm-4 col-xs-4">
<?php
echo CHtml::link('我要约伴', array('yueban/create'), array('class' => 'btn btn-default pull-right'));
?>
</div>
</div><!-- /.row -->
<?php
echo $tabstr;