Skip to content

Commit c6504bd

Browse files
committed
Merge branch '5.4' into 6.3
* 5.4: [Serializer] Better example for date denormalization
2 parents 3e624f3 + 57e50c3 commit c6504bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

serializer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Use the options to specify context specific to normalization or denormalization:
232232
{
233233
#[Context(
234234
normalizationContext: [DateTimeNormalizer::FORMAT_KEY => 'Y-m-d'],
235-
denormalizationContext: [DateTimeNormalizer::FORMAT_KEY => \DateTime::RFC3339],
235+
denormalizationContext: [DateTimeNormalizer::FORMAT_KEY => '!Y-m-d'], // To prevent to have the time from the moment of denormalization
236236
)]
237237
public \DateTimeInterface $createdAt;
238238

0 commit comments

Comments
 (0)