Templating/Helper/TimeFormatterHelper.php
private function formatSimple(\DateInterval $diff)
    {
        $str = '';
        $pre = '';
        if ($diff->y > 0 || $diff->m > 0 || $diff->d == 1 || $diff->h == 1) {
            return $this->formatNormal($diff);
        } else if ($diff->d > 0) {
            $str = "few days";
        } else if ($diff->h > 0) {
            $str = "few hours";
        } else if ($diff->i < 2) {
            $str = "minute";
            $pre = "a ";
        } else if ($diff->i < 20) {
            $str = "15 minutes";
        } else if ($diff->i < 40) {
            $str = "half hour";
        } else if ($diff->i < 60) {
            $str = "hour";
            $pre = "an ";
        }

        return $this->translator->trans($diff->invert ? "next " . $str : $pre . $str . " ago");
    }
private function formatSimple(\DateInterval $diff)
    {
        $str = '';
        $pre = '';
        if ($diff->y > 0 || $diff->m > 0 || $diff->d == 1 || $diff->h == 1) {
            return $this->formatNormal($diff);
        } else if ($diff->d > 0) {
            $str = "few days";
        } else if ($diff->h > 0) {
            $str = "few hours";
        } else if ($diff->i < 2) {
            $str = "minute";
            $pre = "a ";
        } else if ($diff->i < 20) {
            $str = "15 minutes";
        } else if ($diff->i < 40) {
            $str = "half hour";
        } else if ($diff->i < 60) {
            $str = "hour";
            $pre = "an ";
        }

        return $this->translator->trans($diff->invert ? "next " . $str : $pre . $str . " ago");
    }
private function formatSimple ( \ DateInterval $ diff ) { $ str = '' ; $ pre = '' ; if ( $ diff -> y > 0 || $ diff -> m > 0 || $ diff -> d == 1 || $ diff -> h == 1 ) { return $ this -> formatNormal ( $ diff ) ; } else if ( $ diff -> d > 0 ) { $ str = "few days" ; } else if ( $ diff -> h > 0 ) { $ str = "few hours" ; } else if ( $ diff -> i < 2 ) { $ str = "minute" ; $ pre = "a " ; } else if ( $ diff -> i < 20 ) { $ str = "15 minutes" ; } else if ( $ diff -> i < 40 ) { $ str = "half hour" ; } else if ( $ diff -> i < 60 ) { $ str = "hour" ; $ pre = "an " ; } return $ this -> translator -> trans ( $ diff -> invert ? "next " . $ str : $ pre . $ str . " ago" ) ; }
Formating using simple format.

@param \DateInterval $diff

@return string
Formating using simple format .