Skip to content

Commit

Permalink
example update
Browse files Browse the repository at this point in the history
  • Loading branch information
PHPTCloud committed Mar 21, 2022
1 parent c2d284e commit 266a484
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions examples/aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,24 @@
use isDayOff\Client\IsDayOff;

$client = new IsDayOff();
$date = new DateTime();
$tomorrow = clone $date;
$tomorrow->modify('+1 day');

// Tomorrow example
$tomorrowDate = new DateTime();
$tomorrowDate->modify('+1 day');
$result = $client->date()->tomorrow();

if($result)
{
echo $tomorrow->format('Y-m-d') . ' is day off.' . PHP_EOL;
}
else
{
echo $tomorrow->format('Y-m-d') . ' working day.' . PHP_EOL;
if($result) {
echo $tomorrowDate->format('Y-m-d') . ' is day off.' . PHP_EOL;
} else {
echo $tomorrowDate->format('Y-m-d') . ' working day.' . PHP_EOL;
}

// Today example
$todayDate = new DateTime();
$result = $client->date()->today();
if($result)
{
echo $date->format('Y-m-d') . ' is day off.' . PHP_EOL;
}
else
{
echo $date->format('Y-m-d') . ' working day.' . PHP_EOL;

if($result) {
echo $todayDate->format('Y-m-d') . ' is day off.' . PHP_EOL;
} else {
echo $todayDate->format('Y-m-d') . ' working day.' . PHP_EOL;
}

0 comments on commit 266a484

Please sign in to comment.