PHP code example of donatj / simplecalendar

1. Go to this page and download the library: Download donatj/simplecalendar library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

donatj / simplecalendar example snippets




'<link rel="stylesheet" href="../src/css/SimpleCalendar.css" />';

$calendar = new donatj\SimpleCalendar('June 2010');

echo $calendar->render();



 '<link rel="stylesheet" href="../src/css/SimpleCalendar.css" />';

$calendar = new donatj\SimpleCalendar;

$calendar->setStartOfWeek('Sunday');
$calendar->addDailyHtml('Sample Event', 'today', 'tomorrow');

$calendar->setWeekDayNames([ 'Sun', 'Mon', 'Tu', 'W', 'Th', 'F', 'Sa' ]);
$calendar->setStartOfWeek('Monday');

echo $calendar->render();


function __construct($calendarDate = null, $today = null)

function setDate($date = null): void

function setCalendarClasses(array $classes): void
  
[  
   'calendar'     => 'SimpleCalendar',  
   'leading_day'  => 'SCprefix',  
   'trailing_day' => 'SCsuffix',  
   'today'        => 'today',  
   'event'        => 'event',  
   'events'       => 'events',  
]  

function setToday($today = null): void

function setWeekDayNames(?array $weekDayNames = null): void

function addDailyHtml(string $html, $startDate, $endDate = null): void

function clearDailyHtml(): void

function setStartOfWeek($offset): void

function show(bool $echo = true): string

function render(): string