public function formatDate($field, $value, array $options)
    {
        if ($value === null) {
            return $this->Html->label(__d('crud', 'N/A'), ['type' => 'info']);
        }

        if (is_int($value) || is_string($value) || $value instanceof DateTime || $value instanceof DateTimeImmutable) {
            return $this->Time->timeAgoInWords($value, $options);
        }

        return $this->Html->label(__d('crud', 'N/A'), ['type' => 'info']);
    }
public function formatDate($field, $value, array $options)
    {
        if ($value === null) {
            return $this->Html->label(__d('crud', 'N/A'), ['type' => 'info']);
        }

        if (is_int($value) || is_string($value) || $value instanceof DateTime || $value instanceof DateTimeImmutable) {
            return $this->Time->timeAgoInWords($value, $options);
        }

        return $this->Html->label(__d('crud', 'N/A'), ['type' => 'info']);
    }
public function formatDate ( $ field , $ value , array $ options ) { if ( $ value === null ) { return $ this -> Html -> label ( __d ( 'crud' , 'N/A' ) , [ 'type' => 'info' ] ) ; } if ( is_int ( $ value ) || is_string ( $ value ) || $ value instanceof DateTime || $ value instanceof DateTimeImmutable ) { return $ this -> Time -> timeAgoInWords ( $ value , $ options ) ; } return $ this -> Html -> label ( __d ( 'crud' , 'N/A' ) , [ 'type' => 'info' ] ) ; }
Format a date for display

@param string $field Name of field.
@param mixed $value Value of field.
@param array $options Options array.
@return string
Format a date for display