PHP code example of galek / nette-calendar
1. Go to this page and download the library: Download galek/nette-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/ */
galek / nette-calendar example snippets
use \Galek\Utils\Calendar;
$date = new Calendar();
if($date->isWorkday()){
echo "Today is workday :/";
}
if($date->isHoliday()){
echo "Today is holiday :)";
}
// Easter
echo "Easter of this year is: ".$date->getEaster();
echo "Easter of 2020 year is: ".$date->getEaster(2020);
echo "Easter Monday of this year is: ".$date->getEasterMonday();
echo "Easter Big Friday of this year is: ".$date->getBigFriday();
echo "Today or next workday:".$date->getWorkday()->format('d.m.Y');
echo "Next workday:".$date->getWorkday(true)->format('d.m.Y');
// Something for e-shops ;)
$date->setShippingTime(14, 20);
echo "Date for shipping to some Hour and minute:".$date->getShippingDate()->format('d.m.Y');
/**
* $date->setShippingTime(14, 20);
* $date->getShippingDate()
* Friday 9:30 < 14:20 = Monday
* Friday 14:30 > 14:20 = Wednesday (Monday send)
* etc...
**/