1
1
Timezone
2
2
========
3
3
4
- Validates that a value is a valid timezone identifier (ie . ``Europe/Paris ``).
4
+ Validates that a value is a valid timezone identifier (e.g . ``Europe/Paris ``).
5
5
6
6
========== ===================================================================
7
7
Applies to :ref: `property or method <validation-property-target >`
@@ -15,8 +15,8 @@ Validator :class:`Symfony\\Component\\Validator\\Constraints\\TimezoneValidato
15
15
Basic Usage
16
16
-----------
17
17
18
- Suppose you have a ``UserSettings `` class, with a ``timezone `` field that is a string
19
- meant to contain a timezone identifier (ie. `America/New_York `):
18
+ Suppose you have a ``UserSettings `` class, with a ``timezone `` field that is a
19
+ string meant to contain a timezone identifier (ie. `` America/New_York ` `):
20
20
21
21
.. configuration-block ::
22
22
@@ -31,7 +31,6 @@ meant to contain a timezone identifier (ie. `America/New_York`):
31
31
{
32
32
/**
33
33
* @Assert\Timezone
34
- * @var string A timezone identifier
35
34
*/
36
35
protected $timezone;
37
36
}
@@ -69,9 +68,6 @@ meant to contain a timezone identifier (ie. `America/New_York`):
69
68
70
69
class Event
71
70
{
72
- /**
73
- * @var string A timezone identifier
74
- */
75
71
protected $timezone;
76
72
77
73
public static function loadValidatorMetadata(ClassMetadata $metadata)
@@ -90,9 +86,9 @@ Options
90
86
message
91
87
~~~~~~~
92
88
93
- **type **: ``string `` **default **: ``This value is not a valid time . ``
89
+ **type **: ``string `` **default **: ``This value is not a valid timezone . ``
94
90
95
- This message is shown if the underlying data is not a valid time .
91
+ This message is shown if the underlying data is not a valid timezone identifier .
96
92
97
93
You can use the following parameters in this message:
98
94
@@ -107,7 +103,7 @@ Parameter Description
107
103
zone
108
104
~~~~
109
105
110
- **type **: ``string `` **default **: ``\DateTimeZone::ALL. ``
106
+ **type **: ``string `` **default **: ``\DateTimeZone::ALL ``
111
107
112
108
The geographical zone in which to validate the timezone identifier.
113
109
@@ -122,6 +118,7 @@ This option must be used only when the ``zone`` option value equals ``\DateTimeZ
122
118
123
119
The ``countryCode `` option enables to validate the timezone identifier is supported by the country code.
124
120
125
- Value must be a valid `ISO 3166-1 alpha-2 ` country code (ie. ` BE `).
121
+ Value must be a valid `ISO 3166-1 alpha-2 `_ country code (e.g. `` BE ` `).
126
122
127
- .. _DateTimeZone : https://www.php.net/datetimezone
123
+ .. _`DateTimeZone` : https://www.php.net/datetimezone
124
+ .. _`ISO 3166-1 alpha-2` : https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
0 commit comments