Calendar
[ class tree: Calendar ] [ index: Calendar ] [ all elements ]

Class: Calendar_Month_Weekdays

Source Location: /Calendar-0.5.2/Month/Weekdays.php

Class Overview

Calendar
   |
   --Calendar_Month
      |
      --Calendar_Month_Weekdays

Represents a Month and builds Days in tabular form


Author(s):

Methods


Inherited Variables

Inherited Methods

Class: Calendar_Month

Calendar_Month::Calendar_Month()
Constructs Calendar_Month
Calendar_Month::build()
Builds Day objects for this Month. Creates as many Calendar_Day objects

Class: Calendar

Calendar::Calendar()
Constructs the Calendar
Calendar::adjust()
Adjusts the date (helper method)
Calendar::build()
Abstract method for building the children of a calendar object.
Calendar::fetch()
Iterator method for fetching child Calendar subclass objects (e.g. a minute from an hour object). On reaching the end of the collection, returns false and resets the collection for further iteratations.
Calendar::fetchAll()
Fetches all child from the current collection of children
Calendar::getTimestamp()
Returns a timestamp from the current date / time values. Format of
Calendar::getValidator()
Returns an instance of Calendar_Validator
Calendar::isSelected()
True if the calendar subclass object is selected (e.g. today)
Calendar::isValid()
Determine whether this date is valid, with the bounds determined by
Calendar::nextDay()
Returns the value for the next day
Calendar::nextHour()
Returns the value for the next hour
Calendar::nextMinute()
Returns the value for the next minute
Calendar::nextMonth()
Returns the value for next month
Calendar::nextSecond()
Returns the value for the next second
Calendar::nextYear()
Returns the value for next year
Calendar::prevDay()
Returns the value for the previous day
Calendar::prevHour()
Returns the value for the previous hour
Calendar::prevMinute()
Returns the value for the previous minute
Calendar::prevMonth()
Returns the value for the previous month
Calendar::prevSecond()
Returns the value for the previous second
Calendar::prevYear()
Returns the value for the previous year
Calendar::setSelected()
Defines calendar object as selected (e.g. for today)
Calendar::setSelection()
Abstract method for selected data objects called from build
Calendar::setTimestamp()
Defines the calendar by a timestamp (Unix or ISO-8601), replacing values
Calendar::size()
Get the number Calendar subclass objects stored in the internal collection.
Calendar::thisDay()
Returns the value for this day
Calendar::thisHour()
Returns the value for this hour
Calendar::thisMinute()
Returns the value for this minute
Calendar::thisMonth()
Returns the value for this month
Calendar::thisSecond()
Returns the value for this second
Calendar::thisYear()
Returns the value for this year
Calendar::toArray()
Returns the date as an associative array (helper method)

Class Details

[line 68]
Represents a Month and builds Days in tabular form

  1.  require_once 'Calendar'.DIRECTORY_SEPARATOR.'Month'.DIRECTORY_SEPARATOR.'Weekdays.php';
  2.  $Month new Calendar_Month_Weekdays(200310)// Oct 2003
  3.  $Month->build()// Build Calendar_Day objects
  4.  while ($Day $Month->fetch()) {
  5.      if ($Day->isFirst()) {
  6.          echo '<tr>';
  7.      }
  8.      if ($Day->isEmpty()) {
  9.          echo '<td>&nbsp;</td>';
  10.      else {
  11.          echo '<td>'.$Day->thisDay().'</td>';
  12.      }
  13.      if ($Day->isLast()) {
  14.          echo '</tr>';
  15.      }
  16.  }

  • Access: public


[ Top ]


Method Detail

Calendar_Month_Weekdays (Constructor)   [line 91]

Calendar_Month_Weekdays Calendar_Month_Weekdays( int $y, int $m, [int $firstDay = false])

Constructs Calendar_Month_Weekdays
  • Access: public

Parameters:

int   $y   —  year e.g. 2003
int   $m   —  month e.g. 5
int   $firstDay   —  (optional) first day of week (e.g. 0 for Sunday, 2 for Tuesday etc.)

[ Top ]

build   [line 108]

boolean build( [array $sDates = array()])

Builds Day objects in tabular form, to allow display of calendar month with empty cells if the first day of the week does not fall on the first day of the month.

Overrides Calendar_Month::build() (Builds Day objects for this Month. Creates as many Calendar_Day objects)

Parameters:

array   $sDates   —  (optional) Calendar_Day objects representing selected dates

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:54:45 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.