function DateTimeFormatterBase::formatDate

Same name in other branches
  1. 9 core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php \Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeFormatterBase::formatDate()
  2. 8.9.x core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php \Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeFormatterBase::formatDate()
  3. 10 core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php \Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeFormatterBase::formatDate()

Creates a formatted date value as a string.

Parameters

object $date: A date object.

Return value

string A formatted date string using the chosen format.

2 calls to DateTimeFormatterBase::formatDate()
DateTimeFormatterBase::buildDate in core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php
Creates a render array from a date object.
DateTimeFormatterBase::buildDateWithIsoAttribute in core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php
Creates a render array from a date object with ISO date attribute.
3 methods override DateTimeFormatterBase::formatDate()
DateTimeCustomFormatter::formatDate in core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeCustomFormatter.php
Creates a formatted date value as a string.
DateTimeDefaultFormatter::formatDate in core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php
Creates a formatted date value as a string.
DateTimePlainFormatter::formatDate in core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimePlainFormatter.php
Creates a formatted date value as a string.

File

core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php, line 154

Class

DateTimeFormatterBase
Base class for 'DateTime Field formatter' plugin implementations.

Namespace

Drupal\datetime\Plugin\Field\FieldFormatter

Code

protected abstract function formatDate($date);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.