Skip to content

Commit 2e79b95

Browse files
committed
CLICS allowes another format
We should also allow: yyyy-mm-ddThh:mm:ss(.uuu)?[+-]zz(:mm)? besides yyyy-mm-dd hh:mm:ss(.uuu)?[+-]zz(:mm)? ^ See: https://github.com/icpc/ccs-specs/blame/master/Contest_API.md#L233
1 parent 341647e commit 2e79b95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

webapp/src/Validator/Constraints/TimeStringValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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 \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;
1515
$relativeRegex = "\d+:\d\d(:\d\d(\.\d{1,6})?)?";
1616
if (!$constraint instanceof TimeString) {
1717
throw new UnexpectedTypeException($constraint, TimeString::class);

0 commit comments

Comments
 (0)