A very simple, easy to use PHP calendar rendering class.
- PHP 5.3.0+
- ext-calendar
SimpleCalendar is available through Packagist via Composer.
"require": {
"donatj/simplecalendar": "0.*"
}
<?php
require('SimpleCalendar.php');
$Calendar = new donatj\SimpleCalendar('June 2010');
$Calendar->show();
or
<?php
require('SimpleCalendar.php');
$Calendar = new donatj\SimpleCalendar();
$Calendar->setDate('June 5 2010');
$Calendar->show();
Simple Calendar
Constructor - Calls the setDate function
- null | string
$date_string
Sets the date for the calendar
- null | string
$date_string
- Date string parsed by strtotime for the calendar date. If null set to current timestamp.
Add a daily event to the calendar
- string
$html
- The raw HTML to place on the calendar for this event - string
$start_date_string
- Date string for when the event starts - null | string
$end_date_string
- Date string for when the event ends. Defaults to start date
Clear all daily events for the calendar
Sets the first day of the week
- int | string
$offset
- Day to start on, ex: "Monday" or 0-6 where 0 is Sunday
Returns/Outputs the Calendar
- bool
$echo
- Whether to echo resulting calendar
- string - HTML of the Calendar