PHP Класс Cake\Chronos\DifferenceFormatter

Provides a swappable component for other libraries to leverage. when localizing or customizing the difference output.
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( Translator | null $translate = null ) Constructor.
diffForHumans ( Cake\Chronos\ChronosInterface $date, Cake\Chronos\ChronosInterface $other = null, boolean $absolute = false ) : string Get the difference in a human readable format.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( Translator | null $translate = null )
$translate Translator | null The text translator object.

diffForHumans() публичный Метод

Get the difference in a human readable format.
См. также: Cake\Chronos\ChronosInterface::diffForHumans
public diffForHumans ( Cake\Chronos\ChronosInterface $date, Cake\Chronos\ChronosInterface $other = null, boolean $absolute = false ) : string
$date Cake\Chronos\ChronosInterface The datetime to start with.
$other Cake\Chronos\ChronosInterface The datetime to compare against.
$absolute boolean removes time difference modifiers ago, after, etc
Результат string The difference between the two days in a human readable format