diff --git a/library/Icinga/Web/View/helpers/format.php b/library/Icinga/Web/View/helpers/format.php index e9d8e23bc..7b1d3f441 100644 --- a/library/Icinga/Web/View/helpers/format.php +++ b/library/Icinga/Web/View/helpers/format.php @@ -10,6 +10,14 @@ $this->addHelperFunction('format', function () { return Format::getInstance(); }); +$this->addHelperFunction('timeAgo', function ($timestamp) { + return sprintf( + '%s', + date('Y-m-d H:i:s', $timestamp), // TODO: internationalized format + Format::timeAgo($timestamp) + ); +}); + $this->addHelperFunction('timeSince', function ($timestamp) { return sprintf( '%s', @@ -18,14 +26,6 @@ $this->addHelperFunction('timeSince', function ($timestamp) { ); }); -$this->addHelperFunction('prefixedTimeSince', function ($timestamp, $ucfirst = false) { - return sprintf( - '%s', - date('Y-m-d H:i:s', $timestamp), // TODO: internationalized format - Format::prefixedTimeSince($timestamp, $ucfirst) - ); -}); - $this->addHelperFunction('timeUntil', function ($timestamp) { if (! $timestamp) return ''; return sprintf( @@ -35,6 +35,14 @@ $this->addHelperFunction('timeUntil', function ($timestamp) { ); }); +$this->addHelperFunction('prefixedTimeSince', function ($timestamp, $ucfirst = false) { + return sprintf( + '%s', + date('Y-m-d H:i:s', $timestamp), // TODO: internationalized format + Format::prefixedTimeSince($timestamp, $ucfirst) + ); +}); + $this->addHelperFunction('prefixedTimeUntil', function ($timestamp, $ucfirst = false) { if (! $timestamp) return ''; return sprintf(