Provides Packages for working with date and time data
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 classconstructor Calendar::Calendar() -- Constructs the CalendarCalendar::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 childrenCalendar::getTimestamp() -- Returns a timestamp from the current date / time values. Format ofCalendar::getValidator() -- Returns an instance of Calendar_ValidatorCalendar::isSelected() -- True if the calendar subclass object is selected (e.g. today)Calendar::isValid() -- Determine whether this date is valid, with the bounds determined byCalendar::nextDay() -- Returns the value for the next dayCalendar::nextHour() -- Returns the value for the next hourCalendar::nextMinute() -- Returns the value for the next minuteCalendar::nextMonth() -- Returns the value for next monthCalendar::nextSecond() -- Returns the value for the next secondCalendar::nextYear() -- Returns the value for next yearCalendar::prevDay() -- Returns the value for the previous dayCalendar::prevHour() -- Returns the value for the previous hourCalendar::prevMinute() -- Returns the value for the previous minuteCalendar::prevMonth() -- Returns the value for the previous monthCalendar::prevSecond() -- Returns the value for the previous secondCalendar::prevYear() -- Returns the value for the previous yearCalendar::setSelected() -- Defines calendar object as selected (e.g. for today)Calendar::setSelection() -- Abstract method for selected data objects called from buildCalendar::setTimestamp() -- Defines the calendar by a Unix timestamp, replacing valuesCalendar::size() -- Get the number Calendar subclass objects stored in the internal collection.Calendar::thisDay() -- Returns the value for this dayCalendar::thisHour() -- Returns the value for this hourCalendar::thisMinute() -- Returns the value for this minuteCalendar::thisMonth() -- Returns the value for this monthCalendar::thisSecond() -- Returns the value for this secondCalendar::thisYear() -- Returns the value for this yearCalendar_Day -- Calendar_Day APIconstructor Calendar_Day::Calendar_Day() -- Constructs Calendar_DayCalendar_Day::build() -- Builds the Hours of the DayCalendar_Day::isEmpty() -- Calendar_Day::isFirst() -- Returns true if Day object is first in a WeekCalendar_Day::isLast() -- Returns true if Day object is last in a WeekCalendar_Decorator -- Calendar_Decorator APIconstructor Calendar_Decorator::Calendar_Decorator() -- Constructs the Calendar_DecoratorCalendar_Decorator::build() -- Build the childrenCalendar_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 childrenCalendar_Decorator::getTimestamp() -- Returns a timestamp from the current date / time values. Format ofCalendar_Decorator::getValidator() -- Returns an instance of Calendar_ValidatorCalendar_Decorator::isEmpty() -- Calendar_Decorator::isFirst() -- Returns true if Day object is first in a WeekCalendar_Decorator::isLast() -- Returns true if Day object is last in a WeekCalendar_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 byCalendar_Decorator::nextDay() -- Returns the value for the next dayCalendar_Decorator::nextHour() -- Returns the value for the next hourCalendar_Decorator::nextMinute() -- Returns the value for the next minuteCalendar_Decorator::nextMonth() -- Returns the value for next monthCalendar_Decorator::nextSecond() -- Returns the value for the next secondCalendar_Decorator::nextWeek() -- Returns the value for next weekCalendar_Decorator::nextYear() -- Returns the value for next yearCalendar_Decorator::prevDay() -- Returns the value for the previous dayCalendar_Decorator::prevHour() -- Returns the value for the previous hourCalendar_Decorator::prevMinute() -- Returns the value for the previous minuteCalendar_Decorator::prevMonth() -- Returns the value for the previous monthCalendar_Decorator::prevSecond() -- Returns the value for the previous secondCalendar_Decorator::prevWeek() -- Returns the value for the previous weekCalendar_Decorator::prevYear() -- Returns the value for the previous yearCalendar_Decorator::setSelected() -- Defines calendar object as selected (e.g. for today)Calendar_Decorator::setTimestamp() -- Defines the calendar by a Unix timestamp, replacing valuesCalendar_Decorator::size() -- Get the number Calendar subclass objects stored in the internal collection.Calendar_Decorator::thisDay() -- Returns the value for this dayCalendar_Decorator::thisHour() -- Returns the value for this hourCalendar_Decorator::thisMinute() -- Returns the value for this minuteCalendar_Decorator::thisMonth() -- Returns the value for this monthCalendar_Decorator::thisSecond() -- Returns the value for this secondCalendar_Decorator::thisWeek() -- Returns the value for this weekCalendar_Decorator::thisYear() -- Returns the value for this yearCalendar_Decorator_Textual -- Calendar_Decorator_Textual APIconstructor Calendar_Decorator_Textual::Calendar_Decorator_Textual() -- Constructs Calendar_Decorator_TextualCalendar_Decorator_Textual::monthNames() -- Returns an array of 12 month names (first index = 1)Calendar_Decorator_Textual::nextDayName() -- Returns textual representation of the next day of week of the decorated calendar objectCalendar_Decorator_Textual::nextMonthName() -- Returns textual representation of the next month of the decorated calendar objectCalendar_Decorator_Textual::orderedWeekdays() -- Returns the days of the week using the order defined in the decoratedCalendar_Decorator_Textual::prevDayName() -- Returns textual representation of the previous day of week of the decorated calendar objectCalendar_Decorator_Textual::prevMonthName() -- Returns textual representation of the previous month of the decorated calendar objectCalendar_Decorator_Textual::thisDayName() -- Returns textual representation of the day of week of the decorated calendar objectCalendar_Decorator_Textual::thisMonthName() -- Returns textual representation of the month of the decorated calendar objectCalendar_Decorator_Textual::weekdayNames() -- Returns an array of 7 week day names (first index = 0)Calendar_Decorator_Uri -- Calendar_Decorator_Uri APIconstructor Calendar_Decorator_Uri::Calendar_Decorator_Uri() -- Constructs Calendar_Decorator_UriCalendar_Decorator_Uri::next() -- Gets the URI string for the next calendar unitCalendar_Decorator_Uri::prev() -- Gets the URI string for the previous calendar unitCalendar_Decorator_Uri::setFragments() -- Sets the URI fragment namesCalendar_Decorator_Uri::setScalar() -- Puts Uri decorator into "scalar mode" - URI variable names are notCalendar_Decorator_Uri::setSeparator() -- Sets the separator string between fragmentsCalendar_Decorator_Uri::this() -- Gets the URI string for the current calendar unitCalendar_Decorator_Wrapper -- Calendar_Decorator_Wrapper APIconstructor Calendar_Decorator_Wrapper::Calendar_Decorator_Wrapper() -- Constructs Calendar_Decorator_WrapperCalendar_Decorator_Wrapper::fetch() -- Wraps objects returned from fetch in the named Decorator classCalendar_Decorator_Wrapper::fetchAll() -- Wraps the returned calendar objects from fetchAll in the named decoratorCalendar_Engine_Interface -- Calendar_Engine_Interface APICalendar_Engine_Interface::dateToStamp() -- Returns a timestampCalendar_Engine_Interface::getDayOfWeek() -- Returns the number of the day of the week (0=sunday, 1=monday...)Calendar_Engine_Interface::getDaysInMonth() -- Returns the number of days in a month, given year and monthCalendar_Engine_Interface::getDaysInWeek() -- Returns the number of days in a weekCalendar_Engine_Interface::getFirstDayInMonth() -- Returns numeric representation of the day of the week in a month,Calendar_Engine_Interface::getFirstDayOfWeek() -- Returns the default first day of the week as an integer. Must be aCalendar_Engine_Interface::getHoursInDay() -- Returns the number of hours in a dayCalendar_Engine_Interface::getMaxYears() -- The upper limit on years that the Calendar Engine can work withCalendar_Engine_Interface::getMinutesInHour() -- Returns the number of minutes in an hourCalendar_Engine_Interface::getMinYears() -- The lower limit on years that the Calendar Engine can work withCalendar_Engine_Interface::getMonthsInYear() -- Returns the number of months in a yearCalendar_Engine_Interface::getSecondsInMinute() -- Returns the number of seconds in a minutesCalendar_Engine_Interface::getWeekDays() -- Returns the numeric values of the days of the week.Calendar_Engine_Interface::getWeekNInMonth() -- Returns the number of the week in the month, given a dateCalendar_Engine_Interface::getWeekNInYear() -- Returns the number of the week in the year (ISO-8601), given a dateCalendar_Engine_Interface::getWeeksInMonth() -- Returns the number of weeks in the monthCalendar_Engine_Interface::stampToDay() -- Returns a numeric day given a timestampCalendar_Engine_Interface::stampToHour() -- Returns a numeric hour given a timestampCalendar_Engine_Interface::stampToMinute() -- Returns a numeric minute given a timestampCalendar_Engine_Interface::stampToMonth() -- Returns a numeric month given a timestampCalendar_Engine_Interface::stampToSecond() -- Returns a numeric second given a timestampCalendar_Engine_Interface::stampToYear() -- Returns a numeric year given a timestampCalendar_Engine_PearDate -- Calendar_Engine_PearDate APICalendar_Engine_PearDate::adjustDate() -- Set the correct date values (useful for math operations on dates)Calendar_Engine_PearDate::dateToStamp() -- Returns a iso-8601 datetimeCalendar_Engine_PearDate::getDayOfWeek() -- Returns the number of the day of the week (0=sunday, 1=monday...)Calendar_Engine_PearDate::getDaysInMonth() -- Returns the number of days in a month, given year and monthCalendar_Engine_PearDate::getDaysInWeek() -- Returns the number of days in a weekCalendar_Engine_PearDate::getFirstDayInMonth() -- Returns numeric representation of the day of the week in a month,Calendar_Engine_PearDate::getFirstDayOfWeek() -- Returns the default first day of the weekCalendar_Engine_PearDate::getHoursInDay() -- Returns the number of hours in a dayCalendar_Engine_PearDate::getMaxYears() -- The upper limit on years that the Calendar Engine can work withCalendar_Engine_PearDate::getMinutesInHour() -- Returns the number of minutes in an hourCalendar_Engine_PearDate::getMinYears() -- The lower limit on years that the Calendar Engine can work withCalendar_Engine_PearDate::getMonthsInYear() -- Returns the number of months in a yearCalendar_Engine_PearDate::getSecondsInMinute() -- Returns the number of seconds in a minutesCalendar_Engine_PearDate::getWeekDays() -- Returns a list of integer days of the week beginning 0Calendar_Engine_PearDate::getWeekNInMonth() -- Returns the number of the week in the month, given a dateCalendar_Engine_PearDate::getWeekNInYear() -- Returns the number of the week in the year (ISO-8601), given a dateCalendar_Engine_PearDate::getWeeksInMonth() -- Returns the number of weeks in the monthCalendar_Engine_PearDate::stampToDay() -- Returns a numeric day given a iso-8601 datetimeCalendar_Engine_PearDate::stampToHour() -- Returns a numeric hour given a iso-8601 datetimeCalendar_Engine_PearDate::stampToMinute() -- Returns a numeric minute given a iso-8601 datetimeCalendar_Engine_PearDate::stampToMonth() -- Returns a numeric month given a iso-8601 datetimeCalendar_Engine_PearDate::stampToSecond() -- Returns a numeric second given a iso-8601 datetimeCalendar_Engine_PearDate::stampToYear() -- Returns a numeric year given a iso-8601 datetimeCalendar_Engine_UnixTs -- Calendar_Engine_UnixTs APICalendar_Engine_UnixTS::dateToStamp() -- Returns a timestampCalendar_Engine_UnixTS::getDayOfWeek() -- Returns the number of the day of the week (0=sunday, 1=monday...)Calendar_Engine_UnixTS::getDaysInMonth() -- Returns the number of days in a month, given year and monthCalendar_Engine_UnixTS::getDaysInWeek() -- Returns the number of days in a weekCalendar_Engine_UnixTS::getFirstDayInMonth() -- Returns numeric representation of the day of the week in a month,Calendar_Engine_UnixTS::getFirstDayOfWeek() -- Returns the default first day of the weekCalendar_Engine_UnixTS::getHoursInDay() -- Returns the number of hours in a dayCalendar_Engine_UnixTS::getMaxYears() -- The upper limit on years that the Calendar Engine can work withCalendar_Engine_UnixTS::getMinutesInHour() -- Returns the number of minutes in an hourCalendar_Engine_UnixTS::getMinYears() -- The lower limit on years that the Calendar Engine can work withCalendar_Engine_UnixTS::getMonthsInYear() -- Returns the number of months in a yearCalendar_Engine_UnixTS::getSecondsInMinute() -- Returns the number of seconds in a minutesCalendar_Engine_UnixTS::getWeekDays() -- Returns a list of integer days of the week beginning 0Calendar_Engine_UnixTS::getWeekNInMonth() -- Returns the number of the week in the month, given a dateCalendar_Engine_UnixTS::getWeekNInYear() -- Returns the number of the week in the year (ISO-8601), given a dateCalendar_Engine_UnixTS::getWeeksInMonth() -- Returns the number of weeks in the monthCalendar_Engine_UnixTS::stampToDay() -- Returns a numeric day given a timestampCalendar_Engine_UnixTS::stampToHour() -- Returns a numeric hour given a timestampCalendar_Engine_UnixTS::stampToMinute() -- Returns a numeric minute given a timestampCalendar_Engine_UnixTS::stampToMonth() -- Returns a numeric month given a timestampCalendar_Engine_UnixTS::stampToSecond() -- Returns a numeric second given a timestampCalendar_Engine_UnixTS::stampToYear() -- Returns a numeric year given a timestampCalendar_Hour -- Calendar_Hour APIconstructor Calendar_Hour::Calendar_Hour() -- Constructs Calendar_HourCalendar_Hour::build() -- Builds the Minutes in the HourCalendar_Minute -- Calendar_Minute APIconstructor Calendar_Minute::Calendar_Minute() -- Constructs MinuteCalendar_Minute::build() -- Builds the Calendar_Second objectsCalendar_Month -- Calendar_Month APIconstructor Calendar_Month::Calendar_Month() -- Constructs Calendar_MonthCalendar_Month::build() -- Builds Day objects for this Month. Creates as many Calendar_Day objectsCalendar_Month_Weekdays -- Calendar_Month_Weekdays APIconstructor Calendar_Month_Weekdays::Calendar_Month_Weekdays() -- Constructs Calendar_Month_WeekdaysCalendar_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 APIconstructor Calendar_Month_Weeks::Calendar_Month_Weeks() -- Constructs Calendar_Month_WeeksCalendar_Month_Weeks::build() -- Builds Calendar_Week objects for the Month. Note that Calendar_WeekCalendar_Second -- Calendar_Second APIconstructor Calendar_Second::Calendar_Second() -- Constructs SecondCalendar_Second::build() -- Overwrite buildCalendar_Second::fetch() -- Overwrite fetchCalendar_Second::fetchAll() -- Overwrite fetchAllCalendar_Second::size() -- Overwrite sizeCalendar_Table_Helper -- Calendar_Table_Helper APIconstructor Calendar_Table_Helper::Calendar_Table_Helper() -- Constructs Calendar_Table_HelperCalendar_Table_Helper::getDaysOfWeek() -- Returns the order array of days in a weekCalendar_Table_Helper::getEmptyDaysAfter() -- Returns the index of the last real day in the monthCalendar_Table_Helper::getEmptyDaysAfterOffset() -- Returns the index of the last real day in the month, relative to theCalendar_Table_Helper::getEmptyDaysBefore() -- Returns the number of empty days before the real days beginCalendar_Table_Helper::getFirstDay() -- Returns the first day of the monthCalendar_Table_Helper::getNumTableDaysInMonth() -- Returns the number of real days + empty daysCalendar_Table_Helper::getNumWeeks() -- Returns the number of tabular weeks in a monthCalendar_Table_Helper::getWeekStart() -- Returns the timestamp of the first day of the current weekCalendar_Validation_Error -- Calendar_Validation_Error APIconstructor Calendar_Validation_Error::Calendar_Validation_Error() -- Constructs Calendar_Validation_ErrorCalendar_Validation_Error::getMessage() -- Returns the validation error messageCalendar_Validation_Error::getUnit() -- Returns the Date unitCalendar_Validation_Error::getValue() -- Returns the value of the unitCalendar_Validation_Error::toString() -- Returns a string containing the unit, value and error messageCalendar_Validator -- Calendar_Validator APIconstructor Calendar_Validator::Calendar_Validator() -- Constructs Calendar_ValidatorCalendar_Validator::fetch() -- Iterates over any validation errorsCalendar_Validator::isValid() -- Calls all the other isValidXXX() methods in the validatorCalendar_Validator::isValidDay() -- Check whether this is a valid dayCalendar_Validator::isValidHour() -- Check whether this is a valid hourCalendar_Validator::isValidMinute() -- Check whether this is a valid minuteCalendar_Validator::isValidMonth() -- Check whether this is a valid monthCalendar_Validator::isValidSecond() -- Check whether this is a valid secondCalendar_Validator::isValidYear() -- Check whether this is a valid yearCalendar_Week -- Calendar_Week APIconstructor Calendar_Week::Calendar_Week() -- Constructs WeekCalendar_Week::build() -- Builds Calendar_Day objects for this WeekCalendar_Week::getHelper() -- Returns the instance of Calendar_Table_Helper.Calendar_Week::nextWeek() -- Gets the value of the following week, according to the requested formatCalendar_Week::prevWeek() -- Gets the value of the previous week, according to the requested formatCalendar_Week::thisWeek() -- Gets the value of the current week, according to the requested formatCalendar_Year -- Calendar_Year APIconstructor Calendar_Year::Calendar_Year() -- Constructs Calendar_YearCalendar_Year::build() -- Builds the Months of the Year.Package Calendar Constants -- Constants defined in and used by Calendar
Calendar Data Structures
This chapter describes how to use PEAR::Calendar
Who's Online
Guest Users: 9
Deliver First Class Web Sites: 101 Essential Checklists Want to learn how to make your web sites usable and accessible? Want to ensure that your sites meet current best practice, without spending hours trawling through incomprehensible specifications and recommendations from dozens of different books, research papers, and web sites? Want to make sure that the sites you build are "right the first time," requiring no costly redevelopments?
More Sample Chapters