Skip to content

Commit 4bdcc5b

Browse files
authored
[Serializer] Better example for date denormalization
1 parent a3ac92c commit 4bdcc5b

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
@@ -243,7 +243,7 @@ Use the options to specify context specific to normalization or denormalization:
243243
{
244244
#[Context(
245245
normalizationContext: [DateTimeNormalizer::FORMAT_KEY => 'Y-m-d'],
246-
denormalizationContext: [DateTimeNormalizer::FORMAT_KEY => \DateTime::RFC3339],
246+
denormalizationContext: [DateTimeNormalizer::FORMAT_KEY => '!Y-m-d'], // To prevent to have the time from the moment of denormalization
247247
)]
248248
public $createdAt;
249249

0 commit comments

Comments
 (0)