예제 #1
0
<?php

/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
namespace Icinga\Web\View;

use Icinga\Date\DateFormatter;
use Icinga\Util\Format;
$this->addHelperFunction('format', function () {
    return Format::getInstance();
});
$this->addHelperFunction('formatDate', function ($date) {
    if (!$date) {
        return '';
    }
    return DateFormatter::formatDate($date);
});
$this->addHelperFunction('formatDateTime', function ($dateTime) {
    if (!$dateTime) {
        return '';
    }
    return DateFormatter::formatDateTime($dateTime);
});
$this->addHelperFunction('formatDuration', function ($seconds) {
    if (!$seconds) {
        return '';
    }
    return DateFormatter::formatDuration($seconds);
});
$this->addHelperFunction('formatTime', function ($time) {
    if (!$time) {
        return '';