Skip to content

Commit 3f0fdba

Browse files
committed
Tweaks
1 parent 882245c commit 3f0fdba

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

reference/constraints/Week.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ Week
55

66
The ``Week`` constraint was introduced in Symfony 7.2.
77

8-
Validates that a string (or an object implementing the ``Stringable`` PHP interface)
9-
matches a given week number. The week number format is defined by `ISO-8601`_
10-
and should be composed of the year and the week number, separated by a hyphen
11-
(e.g. ``2022-W01``).
8+
Validates that a given string (or an object implementing the ``Stringable`` PHP
9+
interface) represents a valid week number according to the `ISO-8601`_ standard
10+
(e.g. ``2025-W01``).
1211

1312
========== =======================================================================
1413
Applies to :ref:`property or method <validation-property-target>`
@@ -87,10 +86,11 @@ the following:
8786
}
8887
}
8988
90-
.. note::
91-
92-
The constraint also checks that the given week exists in the calendar. For example,
93-
``2022-W53`` is not a valid week number for 2022, because 2022 only had 52 weeks.
89+
This constraint not only checks that the value matches the week number pattern,
90+
but it also verifies that the specified week actually exists in the calendar.
91+
According to the ISO-8601 standard, years can have either 52 or 53 weeks. For example,
92+
``2022-W53`` is not a valid because 2022 only had 52 weeks; but ``2020-W53`` is
93+
valid because 2020 had 53 weeks.
9494

9595
Options
9696
-------
@@ -169,4 +169,4 @@ Parameter Description
169169

170170
.. include:: /reference/constraints/_payload-option.rst.inc
171171

172-
.. _ISO-8601: https://en.wikipedia.org/wiki/ISO_8601
172+
.. _`ISO-8601`: https://en.wikipedia.org/wiki/ISO_8601

0 commit comments

Comments
 (0)