PHP code example of rafapaulino / calendar

1. Go to this page and download the library: Download rafapaulino/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/ */

    

rafapaulino / calendar example snippets



Calendar\Calendar;

$calendar = new Calendar(
    1, //month
    2021, //year
    0, //first day of week 0-6
    true //show 42 days in calendar collumns
);
$month = $calendar->getMonth();
$year = $calendar->getYear();
$days = $calendar->getDays();
$daysWeek = $calendar->getDaysWeek();

 
alendar\Calendar;
use Calendar\Events;

$calendar = new Calendar(1,2021, 0, true);
$events = new Events(1,2021);
$events->addEvent("My brother's birthday","2021-01-17",1);
$events->addEvent("Vacation","2021-01-01",9);
$month = $events->getMonth();
$year = $events->getYear();
$days = $events->getDays();
$daysWeek = $events->getDaysWeek();