1
0
Fork 0
app.sixfold.org/lib/partials/contest-schedule.php

94 lines
3.2 KiB
PHP

<section aria-labelledby="schedule">
<h2 id="schedule">Schedule</h2>
<?php $dates = [
"submitstart" => DateTimeImmutable::createFromFormat(
"U",
$game->submitstart
)->setTimezone($time_zone),
"submitend" => DateTimeImmutable::createFromFormat(
"U",
$game->submitend
)->setTimezone($time_zone),
"onestart" => DateTimeImmutable::createFromFormat(
"U",
$game->onestart
)->setTimezone($time_zone),
"twostart" => DateTimeImmutable::createFromFormat(
"U",
$game->twostart
)->setTimezone($time_zone),
"threestart" => DateTimeImmutable::createFromFormat(
"U",
$game->threestart
)->setTimezone($time_zone),
"gameend" => DateTimeImmutable::createFromFormat(
"U",
$game->gameend
)->setTimezone($time_zone),
]; ?>
<dl class="flow" data-game-status="<?= $game->status_id ?>">
<div data-status="<?= STATUS_ENROLLING ?>">
<dt>Submissions</dt>
<dd><span>Open: </span><time datetime="<?= $dates["submitstart"]->format(
"c"
) ?>"><?= $dates["submitstart"]->format(
'l, j F, o \a\t h:i A T'
) ?></time></dd>
<dd><span>Close: </span><time datetime="<?= $dates["submitend"]->format(
"c"
) ?>"><?= $dates["submitend"]->format(
'l, j F, o \a\t h:i A T'
) ?></time></dd>
</div>
<div data-status="<?= STATUS_REVIEW ?>">
<dt>Document Review</dt>
<dd><span>Start: </span><time datetime="<?= $dates["submitend"]
->add($one_second)
->format("c") ?>"><?= $dates["submitend"]
->add($one_second)
->format('l, j F, o \a\t h:i A T') ?></time></dd>
<dd><span>End: </span><time datetime="<?= $dates["onestart"]
->sub($one_second)
->format("c") ?>"><?= $dates["onestart"]
->sub($one_second)
->format('l, j F, o \a\t h:i A T') ?></time></dd>
</div>
<div data-status="<?= STATUS_ROUND_ONE ?>">
<dt>Round One</dt>
<dd><span>Start: </span><time datetime="<?= $dates["onestart"]->format(
"c"
) ?>"><?= $dates["onestart"]->format(
'l, j F, o \a\t h:i A T'
) ?></time></dd>
<dd><span>End: </span><time datetime="<?= $dates["twostart"]
->sub($one_second)
->format("c") ?>"><?= $dates["twostart"]
->sub($one_second)
->format('l, j F, o \a\t h:i A T') ?></time></dd>
</div>
<div data-status="<?= STATUS_ROUND_TWO ?>">
<dt>Round Two</dt>
<dd><span>Start: </span><time datetime="<?= $dates["twostart"]->format(
"c"
) ?>"><?= $dates["twostart"]->format(
'l, j F, o \a\t h:i A T'
) ?></time></dd>
<dd><span>End: </span><time datetime="<?= $dates["threestart"]
->sub($one_second)
->format("c") ?>"><?= $dates["threestart"]
->sub($one_second)
->format('l, j F, o \a\t h:i A T') ?></time></dd>
</div>
<div data-status="<?= STATUS_ROUND_THREE ?>">
<dt>Round Three</dt>
<dd><span>Start: </span><time datetime="<?= $dates["threestart"]->format(
"c"
) ?>"><?= $dates["threestart"]->format(
'l, j F, o \a\t h:i A T'
) ?></time></dd>
<dd><span>End: </span><time datetime="<?= $dates["gameend"]->format(
"c"
) ?>"><?= $dates["gameend"]->format('l, j F, o \a\t h:i A T') ?></time></dd>
</div>
</dl>
</section>