guild/common/helpers/TimeHelper.php
2022-01-07 15:04:11 +03:00

22 lines
422 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace common\helpers;
use Yii;
use yii\helpers\Html;
class TimeHelper
{
public static function limitTime($time_limit)
{
if ($time_limit === null) {
return 'Не ограничено';
}
return Html::tag(
'span',
Yii::$app->formatter->asDuration(strtotime($time_limit, '0')),
['class' => 'label label-primary']
);
}
}