Subversion Repositories Applications.gtt

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
10 jpm 1
<?php
2
/**
3
* Description: demonstrates using the Weekday decorator
4
*/
5
if (!@include 'Calendar'.DIRECTORY_SEPARATOR.'Calendar.php') {
6
    define('CALENDAR_ROOT', '../../');
7
}
8
require_once CALENDAR_ROOT.'Day.php';
9
require_once CALENDAR_ROOT.'Decorator/Weekday.php';
10
 
11
$Day = new Calendar_Day(date('Y'), date('n'),date('d'));
12
$WeekDay = & new Calendar_Decorator_Weekday($Day);
13
// $WeekDay->setFirstDay(0); // Make Sunday first Day
14
 
15
echo 'Yesterday: '.$WeekDay->prevWeekDay().'<br>';
16
echo 'Today: '.$WeekDay->thisWeekDay().'<br>';
17
echo 'Tomorrow: '.$WeekDay->nextWeekDay().'<br>';
18
 
19
$WeekDay->build();
20
echo 'Hours today:<br>';
21
while ( $Hour = $WeekDay->fetch() ) {
22
    echo $Hour->thisHour().'<br>';
23
}
24
?>