PHP code example of gozoro / yii2-russian-calendar
1. Go to this page and download the library: Download gozoro/yii2-russian-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.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// полный список
print_r($calendar->getHolidayDateArray($date, true);
// Array//(// [0] => 2019-01-01// [1] => 2019-01-02// [2] => 2019-01-03// [3] => 2019-01-04// [4] => 2019-01-05// [5] => 2019-01-06// [6] => 2019-01-07// [7] => 2019-01-08//)// только даты больше чем $date и даты в формате d.m.Y
$holidayArray = $calendar->getHolidayDateArray($date, false, 'd.m.Y';
print_r($holidayArray);
//Array//(// [0] => 03.01.2019// [1] => 04.01.2019// [2] => 05.01.2019// [3] => 06.01.2019// [4] => 07.01.2019// [5] => 08.01.2019//)// Сколько дней осталось отдыхать?print count($holidayArray); // 6
'components' => [
...
'calendar' => [
'class' => 'gozoro\russian_calendar\components\RussianCalendar',
'cacheFolder' => '/home/user/mycache/russian-calendar', // директория для кэша, если не существует, то будет создана автоматически'cacheDuration' => 3600, // время жизни кэша в секундах'fileMode' => 0664, // права на файлы кэша'dirMode' => 0775, // права на директорию кэша'cacheEnable' => true, // включить/отключить использование кэша, по умолчанию true
],
...
],