Skip to content

Commit c3ca09e

Browse files
committed
Allow for ms precision in contest start time.
Also explain why we are stripping off .000. (cherry picked from commit 2cc6b38)
1 parent 6e2b928 commit c3ca09e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

webapp/src/Service/ExternalContestSourceService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,9 +746,10 @@ protected function validateAndUpdateContest(Event $event, EventData $data): void
746746
[$feedTimezone->getName(), $ourTimezone->getName()]
747747
);
748748
}
749+
// We do use precise time with milliseconds if provided, but strip trailing .000 off to make it look nicer.
749750
$toCheck = [
750751
'start_time_enabled' => true,
751-
'start_time_string' => $startTime->format('Y-m-d H:i:s ') . $timezoneToUse,
752+
'start_time_string' => preg_replace('/\.000$/', '', $startTime->format('Y-m-d H:i:s.v')) . ' ' . $timezoneToUse,
752753
'end_time_string' => preg_replace('/\.000$/', '', $fullDuration),
753754
'freeze_time_string' => preg_replace('/\.000$/', '', $fullFreeze),
754755
];

0 commit comments

Comments
 (0)