mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 01:04:09 +02:00
Fix that time-until doesn't show negative partial time in the dashboard
refs #6778
This commit is contained in:
parent
1e9337846a
commit
970d4d7a4a
@ -202,6 +202,9 @@ class DateFormatter
|
|||||||
public static function timeUntil($time, $timeOnly = false)
|
public static function timeUntil($time, $timeOnly = false)
|
||||||
{
|
{
|
||||||
list($type, $until, $invert) = static::diff($time);
|
list($type, $until, $invert) = static::diff($time);
|
||||||
|
if ($invert) {
|
||||||
|
$until = '-' . $until;
|
||||||
|
}
|
||||||
if ($timeOnly) {
|
if ($timeOnly) {
|
||||||
return $until;
|
return $until;
|
||||||
}
|
}
|
||||||
@ -217,7 +220,7 @@ class DateFormatter
|
|||||||
case static::RELATIVE:
|
case static::RELATIVE:
|
||||||
$formatted = sprintf(
|
$formatted = sprintf(
|
||||||
t('in %s', 'An event will happen after the given time interval has elapsed'),
|
t('in %s', 'An event will happen after the given time interval has elapsed'),
|
||||||
$invert ? ('-' . $until) : $until
|
$until
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case static::TIME:
|
case static::TIME:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user