Open mrceperka opened 1 year ago
JS format should already work with default DateTimeValue format. Go format seems to be just a bit more precise? It may work already.
But we should definitely add some tests for created datetime to check how accurate is the result
https://github.com/orisai/object-mapper/blob/e974721d8c8d6008ae811c107bd8e7db942fe2fa/src/Rules/DateTimeRule.php#L134-L136 https://github.com/orisai/object-mapper/blob/e974721d8c8d6008ae811c107bd8e7db942fe2fa/tests/Unit/Rules/DateTimeRuleTest.php#L70 https://github.com/orisai/object-mapper/tree/e974721d8c8d6008ae811c107bd8e7db942fe2fa/docs#datetime-rule
Library version
v1.x-dev
Description
Go serializes time to
2023-07-14T13:52:32.489932695Z
. This includes nanoseconds. PHP is not able to handle nanoseconds andJsIsoFormat
fails.Steps to reproduce
This is probably general PHP problem.
Actual Behavior
DateTimeValue
will say it is not valid dateExpected Behavior
Validation should pass. We can strip those nanos, cos PHP does not support them either (AI said that :D)
Addition information
AI would solve it like this (this works with
u
instead ofv
tho)