1. Go to this page and download the library: Download sportfinder/time 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/ */
sportfinder / time example snippets
namespace SportFinder\Time;
interface DateSlotableInterface
{
public function getStart(): ?\DateTime;
public function getEnd(): ?\DateTime;
public function toDateSlot(): DateSlotInterface;
}
namespace SportFinder\Time;
interface DateSlotInterface extends DateSlotableInterface
{
public function contains($dateTimeOrDateSlot, $openLeft = false, $openRight = false): bool;
public function equals(DateSlotInterface $dateSlot): bool;
public function intersect(DateSlotableInterface $interval = null);
public function subtract($dateSlot);
public function getDuration($unit = Units::SECOND): int;
public function hasTimeLeft(): bool;
public function sub(\DateInterval $interval);
public function add(\DateInterval $interval);
}
namespace SportFinder\Time;
interface ComparatorInterface
{
public function isBefore($dateTimeOrDateSlot, $intervalOpen = false): bool;
public function isAfter($dateTimeOrDateSlot, $intervalOpen = false): bool;
}
namespace SportFinder\Time;
class DateSlot implements DateSlotInterface, DurationInterface, ComparatorInterface{}
namespace SportFinder\Time;
class DateTime extends \DateTime implements ComparatorInterface, DateSlotableInterface{}