Fix that time-until doesn't show negative partial time in the dashboard

refs #6778
This commit is contained in:
Eric Lippmann 2015-05-21 10:19:07 +02:00
parent 1e9337846a
commit 970d4d7a4a

View File

@ -202,6 +202,9 @@ class DateFormatter
public static function timeUntil($time, $timeOnly = false)
{
list($type, $until, $invert) = static::diff($time);
if ($invert) {
$until = '-' . $until;
}
if ($timeOnly) {
return $until;
}
@ -217,7 +220,7 @@ class DateFormatter
case static::RELATIVE:
$formatted = sprintf(
t('in %s', 'An event will happen after the given time interval has elapsed'),
$invert ? ('-' . $until) : $until
$until
);
break;
case static::TIME: