PHP code example of webmasterskaya / production-calendar

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

    

webmasterskaya / production-calendar example snippets


use webmasterskaya\ProductionCalendar\Calendar;
use webmasterskaya\ProductionCalendar\Updater;

Calendar::isWorking($date, $weekend = [6, 0]); //bool

Calendar::isHoliday($date = null); //bool

Calendar::isPreHoliday($date); //bool

Calendar::isNoWorking($date); //bool

Calendar::find($date = null)->working()->format($format = null); //string

Calendar::find($date = null)->holiday()->format($format = null); //string

Calendar::find($date = null)->preHoliday()->format($format = null); //string

Calendar::find($date = null)->noWorking()->format($format = null); //string

Calendar::getWorkingsByYear($year); //array

Calendar::getHolidaysByYear($year); //array

Calendar::getPreHolidaysByYear($year); //array

Calendar::getNoWorkingByYear($year); //array

Calendar::getHolidaysListByInterval($date_from, $date_to, $format = null); //array

Updater::update($year = null); //void

Updater::updateAll(); //void