From fcb5bc7acec9b6f08626afc9ae248a4f7a72f833 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 25 Feb 2014 10:18:09 +0000 Subject: [PATCH] Add TimeUnless helper (still buggy when going below zero) --- application/views/helpers/TimeUnless.php | 46 ++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 application/views/helpers/TimeUnless.php diff --git a/application/views/helpers/TimeUnless.php b/application/views/helpers/TimeUnless.php new file mode 100644 index 000000000..2a9b4c6ee --- /dev/null +++ b/application/views/helpers/TimeUnless.php @@ -0,0 +1,46 @@ + + * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2 + * @author Icinga Development Team + * + */ +// {{{ICINGA_LICENSE_HEADER}}} + +use Icinga\Util\Format; + +/** + * Class Zend_View_Helper_TimeSince + */ +class Zend_View_Helper_TimeUnless extends Zend_View_Helper_Abstract +{ + public function timeUnless($timestamp) + { + return '' + . Format::timeUntil($timestamp) + . ''; + } +} +// @codingStandardsIgnoreStop