From e65f692c32dd4cc198f6069ba26fc7ed537f813a Mon Sep 17 00:00:00 2001 From: Alireza Rahmani Khalili Date: Tue, 2 May 2023 10:26:03 +0330 Subject: [PATCH] Update serializer.rst Constant 'ISO8601' is deprecated This format is not compatible with ISO-8601, but is left this way for backward compatibility reasons. Use DateTime::ATOM or DATE_ATOM for compatibility with ISO-8601 instead. --- components/serializer.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/serializer.rst b/components/serializer.rst index e1f95df346a..319940027a3 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -724,7 +724,7 @@ When serializing, you can set a callback to format a specific object property:: // all callback parameters are optional (you can omit the ones you don't use) $dateCallback = function ($innerObject, $outerObject, string $attributeName, string $format = null, array $context = []) { - return $innerObject instanceof \DateTime ? $innerObject->format(\DateTime::ISO8601) : ''; + return $innerObject instanceof \DateTime ? $innerObject->format(\DateTime::ATOM) : ''; }; $defaultContext = [