\Calendar
Generator for (monthly) calendars
Class Calendar
Synopsis
class Calendar
{
- // constants
- const RESPONSE_DATE = 'Date';
- const RESPONSE_EVENTS = 'Events';
- const RESPONSE_MONTH = 'Month';
- const RESPONSE_MONTH_TEXT = 'Text';
- const RESPONSE_MONTH_NUMERIC = 'Numeric';
- const RESPONSE_YEAR = 'Year';
- const RESPONSE_DAYS = 'Days';
- const RESPONSE_NEXT_MONTH = 'NextMonth';
- const RESPONSE_PREVIOUS_MONTH = 'PreviousMonth';
- // members
- protected DateTimeHelper $start;
- protected DateTimeHelper $end;
- protected ArrayData $days;
- protected DataList $agenda;
- protected ArrayData $emptyDay;
- protected integer $events = 0;
- // methods
- public static ArrayData create()
- public void __construct()
- public void setStart()
- public DateTimeHelper getStart()
- public void setEnd()
- public void setAgenda()
- public void generate()
- protected void generateStartDuds()
- protected void generateDays()
- protected void generateEndDuds()
- protected Calendar findEventsForDay()
- protected ArrayData|static getEmptyDay()
Constants
Name | Value |
---|---|
RESPONSE_DATE | 'Date' |
RESPONSE_EVENTS | 'Events' |
RESPONSE_MONTH | 'Month' |
RESPONSE_MONTH_TEXT | 'Text' |
RESPONSE_MONTH_NUMERIC | 'Numeric' |
RESPONSE_YEAR | 'Year' |
RESPONSE_DAYS | 'Days' |
RESPONSE_NEXT_MONTH | 'NextMonth' |
RESPONSE_PREVIOUS_MONTH | 'PreviousMonth' |
Members
protected
- $agenda
—
DataList
Holder of (this month's) Agenda items - $days
—
ArrayData
The days in this calendar - $emptyDay
—
ArrayData
Holds the representation of an empty day - $end
—
DateTimeHelper
End date for this calendar - $events
—
int
Counter for the number of events - $start
—
DateTimeHelper
Start date for this calendar
Methods
protected
- findEventsForDay() — Find the Agenda items for a given day
- generateDays() — Generate the actual calendar days
- generateEndDuds() — Generate the duds needed after the actual calendar ends
- generateStartDuds() — Generate the duds needed before the actual calendar starts
- getEmptyDay() — Retrieve the empty day representation
public
- __construct() — Calendar constructor.
- create() — Create a fully functional calendar. Can immediately be used in templates.
- generate() — Generate the calendar
- getStart() — Retrieve the start date for this calendar
- setAgenda() — Set the Agenda items for this calendar
- setEnd() — Set the end date for this calendar
- setStart() — Set the start date for this calendar