Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add datetime constructor with timezone handling
It is now possible to use the following signature to map to a datetime: `array{datetime: non-empty-string|int, timezone: \DateTimeZone}`. ```php (new \CuyZ\Valinor\MapperBuilder()) ->registerConstructor( function (\DateTimeInterface $datetime, \DateTimeZone $timezone): \DateTimeInterface { return $datetime->setTimezone($timezone); }, ) ->mapper() ->map(\DateTimeInterface::class, [ 'datetime' => '2024-03-28T21:12:27+00:00', 'timezone' => 'America/New_York', ]); ```
- Loading branch information