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

Class: Calendar_Decorator_Weekday

Source Location: /Calendar-0.5.5/Decorator/Weekday.php

Class Overview

Calendar_Decorator
   |
   --Calendar_Decorator_Weekday

Decorator for fetching the day of the week


Author(s):

Copyright:

  • 2003-2007 Harry Fuecks, Lorenzo Alberton

Methods


Inherited Variables

Inherited Methods

Class: Calendar_Decorator

Calendar_Decorator::Calendar_Decorator()
Constructs the Calendar_Decorator
Calendar_Decorator::adjust()
Adjusts the date (helper method)
Calendar_Decorator::build()
Build the children
Calendar_Decorator::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_Decorator::fetchAll()
Fetches all child from the current collection of children
Calendar_Decorator::getTimestamp()
Returns a timestamp from the current date / time values. Format of timestamp depends on Calendar_Engine implementation being used
Calendar_Decorator::getValidator()
Returns an instance of Calendar_Validator
Calendar_Decorator::isEmpty()
Check if the current object is empty
Calendar_Decorator::isFirst()
Returns true if Day object is first in a Week Only relevant when Day is created by Calendar_Month_Weekdays::build()
Calendar_Decorator::isLast()
Returns true if Day object is last in a Week Only relevant when Day is created by Calendar_Month_Weekdays::build()
Calendar_Decorator::isSelected()
True if the calendar subclass object is selected (e.g. today)
Calendar_Decorator::isValid()
Determine whether this date is valid, with the bounds determined by the Calendar_Engine. The call is passed on to Calendar_Validator::isValid
Calendar_Decorator::nextDay()
Returns the value for the next day
Calendar_Decorator::nextHour()
Returns the value for the next hour
Calendar_Decorator::nextMinute()
Returns the value for the next minute
Calendar_Decorator::nextMonth()
Returns the value for next month
Calendar_Decorator::nextSecond()
Returns the value for the next second
Calendar_Decorator::nextWeek()
Returns the value for next week
Calendar_Decorator::nextYear()
Returns the value for next year
Calendar_Decorator::prevDay()
Returns the value for the previous day
Calendar_Decorator::prevHour()
Returns the value for the previous hour
Calendar_Decorator::prevMinute()
Returns the value for the previous minute
Calendar_Decorator::prevMonth()
Returns the value for the previous month
Calendar_Decorator::prevSecond()
Returns the value for the previous second
Calendar_Decorator::prevWeek()
Returns the value for the previous week
Calendar_Decorator::prevYear()
Returns the value for the previous year
Calendar_Decorator::setSelected()
Defines calendar object as selected (e.g. for today)
Calendar_Decorator::setTimestamp()
Defines the calendar by a Unix timestamp, replacing values passed to the constructor
Calendar_Decorator::size()
Get the number Calendar subclass objects stored in the internal collection
Calendar_Decorator::thisDay()
Returns the value for this day
Calendar_Decorator::thisHour()
Returns the value for this hour
Calendar_Decorator::thisMinute()
Returns the value for this minute
Calendar_Decorator::thisMonth()
Returns the value for this month
Calendar_Decorator::thisSecond()
Returns the value for this second
Calendar_Decorator::thisWeek()
Returns the value for this week
Calendar_Decorator::thisYear()
Returns the value for this year
Calendar_Decorator::toArray()
Returns the date as an associative array (helper method)

Class Details

[line 75]
Decorator for fetching the day of the week

  1.  $Day = new Calendar_Day(20031023);
  2.  $Weekday = new Calendar_Decorator_Weekday($Day);
  3.  $Weekday->setFirstDay(0)// Set first day of week to Sunday (default Mon)
  4.  echo $Weekday->thisWeekDay()// Displays 5 - fifth day of week relative to Sun



[ Top ]


Method Detail

Calendar_Decorator_Weekday (Constructor)   [line 91]

Calendar_Decorator_Weekday Calendar_Decorator_Weekday( object &$Calendar)

Constructs Calendar_Decorator_Weekday
  • Access: public

Parameters:

object   &$Calendar     subclass of Calendar

[ Top ]

nextWeekDay   [line 159]

int nextWeekDay( [string $format = 'int'])

Returns the next weekday
  • Return: numeric day of week or timestamp
  • Access: public

Parameters:

string   $format     (default = 'int') return value format

[ Top ]

prevWeekDay   [line 117]

int prevWeekDay( [string $format = 'int'])

Returns the previous weekday
  • Return: numeric day of week or timestamp
  • Access: public

Parameters:

string   $format     (default = 'int') return value format

[ Top ]

setFirstDay   [line 104]

void setFirstDay( int $firstDay)

Sets the first day of the week (0 = Sunday, 1 = Monday (default) etc)
  • Access: public

Parameters:

int   $firstDay     first day of week

[ Top ]

thisWeekDay   [line 139]

int thisWeekDay( [string $format = 'int'])

Returns the current weekday
  • Return: numeric day of week or timestamp
  • Access: public

Parameters:

string   $format     (default = 'int') return value format

[ Top ]


Documentation generated on Thu, 24 Jun 2010 14:00:14 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.