1. Go to this page and download the library: Download alrik11es/calendar 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/ */
alrik11es / calendar example snippets
$cal = new \SSC\Calendar();
$structure = $cal->getCalendar();
print_r($structure);
foreach($structure as $year):
$cal = new \SSC\Calendar();
$cal->getConfig()->setInterval(new \DateInterval('P12M'));
$cal->day_callback = function($date){
$day = new \stdClass();
$day->has_passed = $date->getTimestamp()<time();
return $day;
};
// Spanish months (There is tons of ways of doing this but...)
$context['months_es'] = array(
1=>'Enero', 'Febrero', 'Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'
);
// The week days order. In spanish calendar this is different than in english.
$context['week_days'] = array(1,2,3,4,5,6,0);
// The calendar structure...
$context['cal'] = $cal->getCalendarStructure();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.