Always show downtime schedule times

This commit is contained in:
Eric Lippmann 2019-07-11 13:07:30 +02:00
parent 1351be7da8
commit ba6b8c04ec
2 changed files with 6 additions and 6 deletions

View File

@ -1,10 +1,10 @@
<td class="state-col state-<?= $stateName; ?><?= $downtime->is_in_effect ? ' handled' : ''; ?>">
<?php if ($downtime->start <= time() && ! $downtime->is_in_effect): ?>
<div class="state-label"><?= $this->translate('ENDS', 'Downtime status'); ?></div>
<div class="state-meta"><?= $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact) ?></div>
<div class="state-meta"><?= $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact, true) ?></div>
<?php else: ?>
<div class="state-label"><?= $downtime->is_in_effect ? $this->translate('EXPIRES', 'Downtime status') : $this->translate('STARTS', 'Downtime status'); ?></div>
<div class="state-meta"><?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?></div>
<div class="state-meta"><?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact, true) ?></div>
<?php endif; ?>
</td>
<td>
@ -47,7 +47,7 @@
)) ?>
</span>
<?php if (! $downtime->is_in_effect && $downtime->start >= time()): ?>
<span><?= sprintf($this->translate('expires %s'), $this->timeUntil($downtime->end)) ?></span>
<span><?= sprintf($this->translate('expires %s'), $this->timeUntil($downtime->end, false, true)) ?></span>
<?php endif ?>
<span class="comment-icons">
<?php if ($downtime->is_flexible): ?>

View File

@ -64,17 +64,17 @@ if (empty($object->comments) && ! $addLink) {
if ((bool) $downtime->is_fixed) {
$state = sprintf(
$this->translate('scheduled %s', 'Last format parameter represents the time scheduled'),
$this->timeUntil($downtime->start)
$this->timeUntil($downtime->start, false, true)
);
} else {
$state = sprintf(
$this->translate('scheduled flexible %s', 'Last format parameter represents the time scheduled'),
$this->timeUntil($downtime->start)
$this->timeUntil($downtime->start, false, true)
);
}
$state .= ' ' . sprintf(
$this->translate('expires %s', 'Last format parameter represents the downtime expire time'),
$this->timeUntil($downtime->end)
$this->timeUntil($downtime->end, false, true)
);
}
}