lib: Provide formatDuration() in our views

refs #6778
This commit is contained in:
Eric Lippmann 2015-05-22 10:04:00 +02:00
parent edd386e14b
commit de9be044b3
1 changed files with 7 additions and 0 deletions

View File

@ -24,6 +24,13 @@ $this->addHelperFunction('formatDateTime', function ($dateTime) {
return DateFormatter::formatDateTime($dateTime);
});
$this->addHelperFunction('formatDuration', function ($seconds) {
if (! $seconds) {
return '';
}
return DateFormatter::formatDuration($seconds);
});
$this->addHelperFunction('formatTime', function ($time) {
if (! $time) {
return '';