public static function formatField(Field $field)
    {
        $timestamp = $field->value ? $field->value->getTimestamp() : 0;

        return DateToolbox::formatDate($field->view_mode_settings['format'], $timestamp);
    }
public static function formatField(Field $field)
    {
        $timestamp = $field->value ? $field->value->getTimestamp() : 0;

        return DateToolbox::formatDate($field->view_mode_settings['format'], $timestamp);
    }
public static function formatField ( Field $ field ) { $ timestamp = $ field -> value ? $ field -> value -> getTimestamp ( ) : 0 ; return DateToolbox :: formatDate ( $ field -> view_mode_settings [ 'format' ] , $ timestamp ) ; }
Formats the given DateField accordingly to current view-mode.

@param \Field\Model\Entity\Field $field The field to be formatted
@return string Formated date. e.g. `2036-01-01`
Formats the given DateField accordingly to current view - mode .