Frontend\Core\Engine\TemplateModifiers::timeAgo PHP Method

timeAgo() public static method

Formats a timestamp as a string that indicates the time ago syntax: {{ $string|timeago }}.
public static timeAgo ( string $string = null ) : string
$string string A UNIX-timestamp that will be formatted as a time-ago-string.
return string
    public static function timeAgo($string = null)
    {
        $string = (int) $string;
        // invalid timestamp
        if ($string == 0) {
            return '';
        }
        // return
        return '<abbr title="' . \SpoonDate::getDate(FrontendModel::get('fork.settings')->get('Core', 'date_format_long') . ', ' . FrontendModel::get('fork.settings')->get('Core', 'time_format'), $string, Locale::frontendLanguage()) . '">' . \SpoonDate::getTimeAgo($string, Locale::frontendLanguage()) . '</abbr>';
    }