Skeleton is ready
This commit is contained in:
11
app/Kernel/DateTime/Format.php
Normal file
11
app/Kernel/DateTime/Format.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Kernel\DateTime;
|
||||
|
||||
enum Format: string
|
||||
{
|
||||
case CutISO8601DateTime = 'Y-m-d H:i:s';
|
||||
case CutISO8601Date = 'Y-m-d';
|
||||
}
|
||||
17
app/Kernel/DateTime/Util.php
Normal file
17
app/Kernel/DateTime/Util.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Kernel\DateTime;
|
||||
|
||||
use DateTimeInterface;
|
||||
|
||||
class Util
|
||||
{
|
||||
public static function toString(
|
||||
DateTimeInterface $datetime,
|
||||
Format $format
|
||||
): string{
|
||||
return $datetime->format($format->value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user