File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
src/Validator/Constraints
tests/Unit/Controller/Jury Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class TimeStringValidator extends ConstraintValidator
11
11
public function validate (mixed $ value , Constraint $ constraint ): void
12
12
{
13
13
$ timezoneRegex = "[A-Za-z][A-Za-z0-9_\/+-]{1,35} " ; # See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
14
- $ absoluteRegex = "\d\d\d\d-\d\d-\d\d( |T)\d\d:\d\d:\d\d(\.\d{1,6})? " . $ timezoneRegex ;
14
+ $ absoluteRegex = "\d\d\d\d-\d\d-\d\d( |T)\d\d:\d\d:\d\d(\.\d{1,6})?( " . $ timezoneRegex . " |Z) " ;
15
15
$ relativeRegex = "\d+:\d\d(:\d\d(\.\d{1,6})?)? " ;
16
16
if (!$ constraint instanceof TimeString) {
17
17
throw new UnexpectedTypeException ($ constraint , TimeString::class);
Original file line number Diff line number Diff line change @@ -49,6 +49,14 @@ class ContestControllerTest extends JuryControllerTestCase
49
49
'silverMedals ' => '1 ' ,
50
50
'bronzeMedals ' => '1 ' ,
51
51
'medalCategories ' => ['0 ' => '2 ' ]],
52
+ ['shortname ' => 'utc_Z ' ,
53
+ 'name ' => 'UTC (Z) ' ,
54
+ 'activatetimeString ' => '2021-07-17 16:08:00Z ' ,
55
+ 'starttimeString ' => '2021-07-17 16:09:00.0Z ' ,
56
+ 'freezetimeString ' => '2021-07-17 16:10:00.00Z ' ,
57
+ 'endtimeString ' => '2021-07-17 16:11:00.000Z ' ,
58
+ 'unfreezetimeString ' => '2021-07-17T16:12:00.1Z ' ,
59
+ 'deactivatetimeString ' => '2021-07-17T16:13:00.2Z ' ],
52
60
['shortname ' => 'otzcet ' ,
53
61
'name ' => 'Other timezone (CET) ' ,
54
62
'activatetimeString ' => '2021-07-17 16:08:00 CET ' ,
You can’t perform that action at this time.
0 commit comments