PEAR Manual
Prev | Chapter 34. Date and Time | Next

# Calendar

Table of Contents
Introduction -- What Calendar can do
Installing -- How to install PEAR::Calendar
In A Hurry -- Just add hot water...
Package Overview -- Summary of Calendar Classes
Method Overview -- Summary of Calendar API
Calendar Decorators -- What Calendar_Decorator is for
FAQ -- Frequently Asked Questions
Calendar -- Calendar base class
constructor 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 Unix timestamp, 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_Year -- Calendar_Year API
constructor Calendar_Year::Calendar_Year() -- Constructs Calendar_Year
Calendar_Year::build() -- Builds the Months of the Year.
Calendar_Month -- Calendar_Month API
constructor Calendar_Month::Calendar_Month() -- Constructs Calendar_Month
Calendar_Month::build() -- Builds Day objects for this Month. Creates as many Calendar_Day objects
Calendar_Month_Weekdays -- Calendar_Month_Weekdays API
constructor Calendar_Month_Weekdays::Calendar_Month_Weekdays() -- Constructs Calendar_Month_Weekdays
Calendar_Month_Weekdays::build() -- 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.
Calendar_Month_Weeks -- Calendar_Month_Weeks API
constructor Calendar_Month_Weeks::Calendar_Month_Weeks() -- Constructs Calendar_Month_Weeks
Calendar_Month_Weeks::build() -- Builds Calendar_Week objects for the Month. Note that Calendar_Week
Calendar_Week -- Calendar_Week API
constructor Calendar_Week::Calendar_Week() -- Constructs Week
Calendar_Week::build() -- Builds Calendar_Day objects for this Week
Calendar_Week::nextWeek() -- Gets the value of the following week, according to the requested format
Calendar_Week::prevWeek() -- Gets the value of the previous week, according to the requested format
Calendar_Week::thisWeek() -- Gets the value of the current week, according to the requested format
Calendar_Day -- Calendar_Day API
constructor Calendar_Day::Calendar_Day() -- Constructs Calendar_Day
Calendar_Day::build() -- Builds the Hours of the Day
Calendar_Day::isEmpty() --
Calendar_Day::isFirst() -- Returns true if Day object is first in a Week
Calendar_Day::isLast() -- Returns true if Day object is last in a Week
Calendar_Hour -- Calendar_Hour API
constructor Calendar_Hour::Calendar_Hour() -- Constructs Calendar_Hour
Calendar_Hour::build() -- Builds the Minutes in the Hour
Calendar_Minute -- Calendar_Minute API
constructor Calendar_Minute::Calendar_Minute() -- Constructs Minute
Calendar_Minute::build() -- Builds the Calendar_Second objects
Calendar_Second -- Calendar_Second API
constructor Calendar_Second::Calendar_Second() -- Constructs Second
Calendar_Second::build() -- Overwrite build
Calendar_Second::fetch() -- Overwrite fetch
Calendar_Second::fetchAll() -- Overwrite fetchAll
Calendar_Second::size() -- Overwrite size
Calendar_Validation_Error -- Calendar_Validation_Error API
constructor Calendar_Validation_Error::Calendar_Validation_Error() -- Constructs Calendar_Validation_Error
Calendar_Validation_Error::getMessage() -- Returns the validation error message
Calendar_Validation_Error::getUnit() -- Returns the Date unit
Calendar_Validation_Error::getValue() -- Returns the value of the unit
Calendar_Validation_Error::toString() -- Returns a string containing the unit, value and error message
Calendar_Validator -- Calendar_Validator API
constructor Calendar_Validator::Calendar_Validator() -- Constructs Calendar_Validator
Calendar_Validator::fetch() -- Iterates over any validation errors
Calendar_Validator::isValid() -- Calls all the other isValidXXX() methods in the validator
Calendar_Validator::isValidDay() -- Check whether this is a valid day
Calendar_Validator::isValidHour() -- Check whether this is a valid hour
Calendar_Validator::isValidMinute() -- Check whether this is a valid minute
Calendar_Validator::isValidMonth() -- Check whether this is a valid month
Calendar_Validator::isValidSecond() -- Check whether this is a valid second
Calendar_Validator::isValidYear() -- Check whether this is a valid year
Package Calendar Constants -- Constants defined in and used by Calendar

Calendar Data Structures

This chapter describes how to use PEAR::Calendar

Prev | Home | Next
Date and Time | Up | Introduction