Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4bdcc5b

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

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎serializer.rst

Copy file name to clipboardExpand all lines: serializer.rst
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.