\addons\signin\libraryCalendar

Simple PHP Calendar Class.

Summary

Methods
Properties
Constants
addEvent()
addEvents()
clearEvents()
draw()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
findEvents()
$date
$events
N/A

Properties

$date

$date : \DateTime

The internal date pointer.

Type

\DateTime —

$events

$events : array

The events array.

Type

array

Methods

addEvent()

addEvent(string  $start, string  $end, string  $summary = false, bool  $mask = false, bool  $classes = false) : object

Add an event to the current calendar instantiation.

Parameters

string $start

The start date in Y-m-d format.

string $end

The end date in Y-m-d format.

string $summary

The summary string of the event.

bool $mask

The masking class.

bool $classes

(optional) A list of classes to use for the event.

Returns

object —

Return this object for chain-ability.

addEvents()

addEvents(array  $events) : object

Add an array of events using $this->addEvent();

Each array element must have the following: 'start' => start date in Y-m-d format. 'end' => end date in Y-m-d format. (optional) 'mask' => a masking class name. (optional) 'classes' => custom classes to include.

Parameters

array $events

The events array.

Returns

object —

Return this object for chain-ability.

clearEvents()

clearEvents() : object

Remove all events tied to this calendar

Returns

object —

Return this object for chain-ability.

draw()

draw(string  $date = false, mixed  $color = false) : string

Draw the calendar and echo out.

Parameters

string $date

The date of this calendar.

mixed $color

Returns

string —

The calendar

findEvents()

findEvents(\DateTime  $date) : array

Find an event from the internal pool

Parameters

\DateTime $date

The date to match an event for.

Returns

array —

Either an array of events or false.