source: branches/version-2_5-dev/data/module/Calendar/docs/examples/19.php @ 20119

Revision 20119, 698 bytes checked in by nanasess, 13 years ago (diff)

module 以下は svn:keywords を除外

  • Property svn:eol-style set to LF
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
1<?php
2/**
3* Description: demonstrates using the Weekday decorator
4*/
5if (!@include 'Calendar'.DIRECTORY_SEPARATOR.'Calendar.php') {
6    define('CALENDAR_ROOT', '../../');
7}
8require_once CALENDAR_ROOT.'Day.php';
9require_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
15echo 'Yesterday: '.$WeekDay->prevWeekDay().'<br>';
16echo 'Today: '.$WeekDay->thisWeekDay().'<br>';
17echo 'Tomorrow: '.$WeekDay->nextWeekDay().'<br>';
18
19$WeekDay->build();
20echo 'Hours today:<br>';
21while ( $Hour = $WeekDay->fetch() ) {
22    echo $Hour->thisHour().'<br>';
23}
24?>
Note: See TracBrowser for help on using the repository browser.