Source for file 3.php
Documentation is available at 3.php
* Description: Performs same behaviour as 2.php but uses Month::buildWeekDays()
return ((float) $usec + (float) $sec);
if ( !@include 'Calendar/Calendar.php' ) {
define ('CALENDAR_ROOT','../../');
require_once CALENDAR_ROOT. 'Month/Weekdays.php';
require_once CALENDAR_ROOT. 'Day.php';
if (!isset ($_GET['y'])) $_GET['y'] = date('Y');
if (!isset ($_GET['m'])) $_GET['m'] = date('m');
if (!isset ($_GET['d'])) $_GET['d'] = date('d');
// Construct strings for next/previous links
$PMonth = $Month->prevMonth ('object'); // Get previous month as object
$prev = $_SERVER['PHP_SELF']. '?y='. $PMonth->thisYear (). '&m='. $PMonth->thisMonth (). '&d='. $PMonth->thisDay ();
$NMonth = $Month->nextMonth ('object');
$next = $_SERVER['PHP_SELF']. '?y='. $NMonth->thisYear (). '&m='. $NMonth->thisMonth (). '&d='. $NMonth->thisDay ();
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<title> Calendar </title>
background-color: silver;
background-color: yellow;
// Build the days in the month
$Month->build ($selectedDays);
<h2>Built with Calendar_Month_Weekday::build()</h2>
<?php echo ( date('F Y',$Month->getTimeStamp ())); ?>
while ( $Day = $Month->fetch () ) {
// Build a link string for each day
$link = $_SERVER['PHP_SELF'].
// isFirst() to find start of week
if ( $Day->isSelected () ) {
echo ( "<td class=\"selected\">". $Day->thisDay (). "</td>\n" );
} else if ( $Day->isEmpty () ) {
echo ( "<td> </td>\n" );
echo ( "<td><a href=\"". $link. "\">". $Day->thisDay (). "</a></td>\n" );
// isLast() to find end of week
<a href=" <?php echo ($prev); ?>" class="prevMonth"><< </a>
<td colspan="5"> </td>
<a href=" <?php echo ($next); ?>" class="nextMonth"> >></a>
echo ( '<p><b>Took: '. (getmicrotime()- $start). ' seconds</b></p>' );
Documentation generated on Mon, 11 Mar 2019 15:37:47 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|