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
1111 public function validate (mixed $ value , Constraint $ constraint ): void
1212 {
1313 $ 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) " ;
1515 $ relativeRegex = "\d+:\d\d(:\d\d(\.\d{1,6})?)? " ;
1616 if (!$ constraint instanceof TimeString) {
1717 throw new UnexpectedTypeException ($ constraint , TimeString::class);
Original file line number Diff line number Diff line change @@ -49,6 +49,14 @@ class ContestControllerTest extends JuryControllerTestCase
4949 'silverMedals ' => '1 ' ,
5050 'bronzeMedals ' => '1 ' ,
5151 '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 ' ],
5260 ['shortname ' => 'otzcet ' ,
5361 'name ' => 'Other timezone (CET) ' ,
5462 'activatetimeString ' => '2021-07-17 16:08:00 CET ' ,
You can’t perform that action at this time.
0 commit comments