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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy