PHP code example of pizar / carbon-it-holidays

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

    

pizar / carbon-it-holidays example snippets



ITHolidays\Carbon;


re 'path/to/pizar/Carbon.php';

use ITHolidays\Carbon;

$carbon = new Carbon();
$carbon = Carbon::create(2018, 12, 25);
$carbon->isHoliday(); // bool (true)

$carbon = new Carbon();
$carbon = Carbon::create(2018, 12, 31);
$carbon->getHolidayName(); // New Year's Eve

$carbon = new Carbon();
$carbon = Carbon::create(2018, 1, 1);

$carbon->getNewYearsDayHoliday();                   // 2019-01-01 00:00:00
$carbon->getEpiphanyHoliday();                      // 2019-01-06 00:00:00
$carbon->getEasterMondayHoliday();                  // 2019-04-22 00:00:00
$carbon->getLiberationDayHoliday();                 // 2018-04-25 00:00:00
$carbon->getLabourDayHoliday();                     // 2018-05-01 00:00:00
$carbon->getRepublicDayHoliday();                   // 2018-06-02 00:00:00
$carbon->getAssumptionOfMaryHoliday();              // 2018-08-15 00:00:00
$carbon->getFerragosto();                           // 2018-08-15 00:00:00
$carbon->getAllSaintsDayHoliday();                  // 2018-11-01 00:00:00
$carbon->getImmaculateConceptionDayHoliday();       // 2018-12-08 00:00:00
$carbon->getChristmasDayHoliday();                  // 2018-12-25 00:00:00
$carbon->getStStephenDayHoliday();                  // 2018-12-26 00:00:00