IcingaObject: render 0 seconds as 0, not 0m

This commit is contained in:
Thomas Gelf 2015-12-03 18:05:10 +01:00
parent 457fb859e4
commit 3373b67d44
1 changed files with 3 additions and 3 deletions

View File

@ -707,10 +707,10 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
protected function renderPropertyAsSeconds($key)
{
$value = $this->$key;
$value = (int) $this->$key;
if ($value % 60 === 0) {
$value = ((int) $value / 60) . 'm';
if ($value > 0 && $value % 60 === 0) {
$value = (int) ($value / 60) . 'm';
}
return c::renderKeyValue($key, $value);