diff --git a/library/Icinga/Web/View/helpers/format.php b/library/Icinga/Web/View/helpers/format.php
index c5f7ca9e6..6011c954f 100644
--- a/library/Icinga/Web/View/helpers/format.php
+++ b/library/Icinga/Web/View/helpers/format.php
@@ -11,6 +11,9 @@ $this->addHelperFunction('format', function () {
});
$this->addHelperFunction('timeAgo', function ($timestamp) {
+ if (! $timestamp) {
+ return '';
+ }
return sprintf(
'%s',
date('Y-m-d H:i:s', $timestamp), // TODO: internationalized format
@@ -19,6 +22,9 @@ $this->addHelperFunction('timeAgo', function ($timestamp) {
});
$this->addHelperFunction('timeSince', function ($timestamp) {
+ if (! $timestamp) {
+ return '';
+ }
return sprintf(
'%s',
date('Y-m-d H:i:s', $timestamp), // TODO: internationalized format
@@ -27,7 +33,9 @@ $this->addHelperFunction('timeSince', function ($timestamp) {
});
$this->addHelperFunction('timeUntil', function ($timestamp) {
- if (! $timestamp) return '';
+ if (! $timestamp) {
+ return '';
+ }
return sprintf(
'%s',
date('Y-m-d H:i:s', $timestamp), // TODO: internationalized format