Skip to content

Commit

Permalink
refactor: convert dates to timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
simPod committed Jan 29, 2025
1 parent 9a90f8e commit c694491
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Param/ParamValueConverterRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,14 @@ private static function decimalConverter(): Closure
private static function dateConverter(): Closure
{
return static fn (DateTimeInterface|string|int|float $value) => $value instanceof DateTimeInterface
? $value->format('Y-m-d')
? $value->getTimestamp()
: $value;
}

private static function dateTimeConverter(): Closure
{
return static fn (DateTimeInterface|string|int|float $value) => $value instanceof DateTimeInterface
? $value->format('Y-m-d H:i:s')
? $value->getTimestamp()
: $value;
}

Expand Down

0 comments on commit c694491

Please sign in to comment.