parent
7f73c6ae29
commit
3ec6caa15b
|
@ -10,6 +10,14 @@ $this->addHelperFunction('format', function () {
|
|||
return Format::getInstance();
|
||||
});
|
||||
|
||||
$this->addHelperFunction('timeAgo', function ($timestamp) {
|
||||
return sprintf(
|
||||
'<span class="timeAgo" title="%s">%s</span>',
|
||||
date('Y-m-d H:i:s', $timestamp), // TODO: internationalized format
|
||||
Format::timeAgo($timestamp)
|
||||
);
|
||||
});
|
||||
|
||||
$this->addHelperFunction('timeSince', function ($timestamp) {
|
||||
return sprintf(
|
||||
'<span class="timesince" title="%s">%s</span>',
|
||||
|
@ -18,14 +26,6 @@ $this->addHelperFunction('timeSince', function ($timestamp) {
|
|||
);
|
||||
});
|
||||
|
||||
$this->addHelperFunction('prefixedTimeSince', function ($timestamp, $ucfirst = false) {
|
||||
return sprintf(
|
||||
'<span class="timesince" title="%s">%s</span>',
|
||||
date('Y-m-d H:i:s', $timestamp), // TODO: internationalized format
|
||||
Format::prefixedTimeSince($timestamp, $ucfirst)
|
||||
);
|
||||
});
|
||||
|
||||
$this->addHelperFunction('timeUntil', function ($timestamp) {
|
||||
if (! $timestamp) return '';
|
||||
return sprintf(
|
||||
|
@ -35,6 +35,14 @@ $this->addHelperFunction('timeUntil', function ($timestamp) {
|
|||
);
|
||||
});
|
||||
|
||||
$this->addHelperFunction('prefixedTimeSince', function ($timestamp, $ucfirst = false) {
|
||||
return sprintf(
|
||||
'<span class="timesince" title="%s">%s</span>',
|
||||
date('Y-m-d H:i:s', $timestamp), // TODO: internationalized format
|
||||
Format::prefixedTimeSince($timestamp, $ucfirst)
|
||||
);
|
||||
});
|
||||
|
||||
$this->addHelperFunction('prefixedTimeUntil', function ($timestamp, $ucfirst = false) {
|
||||
if (! $timestamp) return '';
|
||||
return sprintf(
|
||||
|
|
Loading…
Reference in New Issue