By the time of publication, Calendar could be
officially stable, meaning you won??™t need to include this flag. See Chapter 11 for a
complete introduction to PEAR and the install command.
Working with Calendar
In addition to the Calendar base class, the Calendar package consists of several public
classes broken down into four distinct groups:
Date classes: Used to manage the six date components: years, months, days,
hours, minutes, and seconds. A separate class exists for each component:
Calendar_Year, Calendar_Month, Calendar_Day, Calendar_Hour, Calendar_Minute,
and Calendar_Second.
Tabular date classes: Used to build monthly and weekly grid-based calendars.
Three classes are available: Calendar_Month_Weekdays, Calendar_Month_Weeks,
and Calendar_Week. These classes are useful for building monthly tabular calendars
in daily and weekly formats, and weekly tabular calendars in a seven-day
format, respectively.
Validation classes: Used to validate dates. The two classes are Calendar_Validator,
which is used to validate any component of a date and can be called by any
subclass, and Calendar_Validation_Error, which offers an additional level of
reporting if something is wrong with a date and provides several methods for
dissecting the date value.
Decorator classes: Used to extend the capabilities of the other subclasses without
having to actually extend them. For instance, suppose you want to extend Calendar??™s
functionality with a few features for analyzing the number of Saturdays falling
on the 17th of any given month.
Pages:
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419