fix: will start in ceil(x) days
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2022-09-26 17:04:13 +08:00
parent fc66e5afe5
commit e013100989
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -57,7 +57,7 @@
$rest_seconds = $contest['start_time']->getTimestamp() - UOJTime::$time_now->getTimestamp(); $rest_seconds = $contest['start_time']->getTimestamp() - UOJTime::$time_now->getTimestamp();
?> ?>
<?php if ($rest_seconds > 86400): ?> <?php if ($rest_seconds > 86400): ?>
<?= UOJLocale::get('contests::will start in x days', floor($rest_seconds / 86400)) ?> <?= UOJLocale::get('contests::will start in x days', ceil($rest_seconds / 86400)) ?>
<?php else: ?> <?php else: ?>
<div id="contest-<?= $contest['id'] ?>-countdown"></div> <div id="contest-<?= $contest['id'] ?>-countdown"></div>
<script>$('#contest-<?= $contest['id'] ?>-countdown').countdown(<?= $rest_seconds ?>, function(){}, 'inherit', false);</script> <script>$('#contest-<?= $contest['id'] ?>-countdown').countdown(<?= $rest_seconds ?>, function(){}, 'inherit', false);</script>