mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 22:04:25 +02:00
parent
44c8d37288
commit
ff45faf123
@ -140,15 +140,6 @@ class Format
|
|||||||
return DateFormatter::create(DateFormatter::SINCE)->format($time);
|
return DateFormatter::create(DateFormatter::SINCE)->format($time);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function prefixedTimeUntil($timestamp, $ucfirst)
|
|
||||||
{
|
|
||||||
$result = self::smartTimeDiff($timestamp - time(), $timestamp, true);
|
|
||||||
if ($ucfirst) {
|
|
||||||
$result = ucfirst($result);
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static function formatForUnits($value, & $units, $base)
|
protected static function formatForUnits($value, & $units, $base)
|
||||||
{
|
{
|
||||||
$sign = '';
|
$sign = '';
|
||||||
|
@ -35,15 +35,6 @@ $this->addHelperFunction('timeUntil', function ($timestamp) {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->addHelperFunction('prefixedTimeUntil', function ($timestamp, $ucfirst = false) {
|
|
||||||
if (! $timestamp) return '';
|
|
||||||
return sprintf(
|
|
||||||
'<span class="timeuntil" title="%s">%s</span>',
|
|
||||||
date('Y-m-d H:i:s', $timestamp), // TODO: internationalized format
|
|
||||||
Format::prefixedTimeUntil($timestamp, $ucfirst)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
$this->addHelperFunction('dateTimeRenderer', function ($dateTimeOrTimestamp, $future = false) {
|
$this->addHelperFunction('dateTimeRenderer', function ($dateTimeOrTimestamp, $future = false) {
|
||||||
return DateTimeRenderer::create($dateTimeOrTimestamp, $future);
|
return DateTimeRenderer::create($dateTimeOrTimestamp, $future);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user