class DateRangeDefaultFormatter
Same name in other branches
- 9 core/modules/datetime_range/src/Plugin/Field/FieldFormatter/DateRangeDefaultFormatter.php \Drupal\datetime_range\Plugin\Field\FieldFormatter\DateRangeDefaultFormatter
- 8.9.x core/modules/datetime_range/src/Plugin/Field/FieldFormatter/DateRangeDefaultFormatter.php \Drupal\datetime_range\Plugin\Field\FieldFormatter\DateRangeDefaultFormatter
- 10 core/modules/datetime_range/src/Plugin/Field/FieldFormatter/DateRangeDefaultFormatter.php \Drupal\datetime_range\Plugin\Field\FieldFormatter\DateRangeDefaultFormatter
Plugin implementation of the 'Default' formatter for 'daterange' fields.
This formatter renders the data range using <time> elements, with configurable date formats (from the list of configured formats) and a separator.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
- class \Drupal\Core\Field\PluginSettingsBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Field\PluginSettingsInterface, \Drupal\Component\Plugin\DependentPluginInterface
- class \Drupal\Core\Field\FormatterBase extends \Drupal\Core\Field\PluginSettingsBase implements \Drupal\Core\Field\FormatterInterface, \Drupal\Core\Plugin\ContainerFactoryPluginInterface
- class \Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeFormatterBase extends \Drupal\Core\Field\FormatterBase
- class \Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeDefaultFormatter extends \Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeFormatterBase
- class \Drupal\datetime_range\Plugin\Field\FieldFormatter\DateRangeDefaultFormatter extends \Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeDefaultFormatter uses \Drupal\datetime_range\DateTimeRangeTrait
- class \Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeDefaultFormatter extends \Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeFormatterBase
- class \Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeFormatterBase extends \Drupal\Core\Field\FormatterBase
- class \Drupal\Core\Field\FormatterBase extends \Drupal\Core\Field\PluginSettingsBase implements \Drupal\Core\Field\FormatterInterface, \Drupal\Core\Plugin\ContainerFactoryPluginInterface
- class \Drupal\Core\Field\PluginSettingsBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Field\PluginSettingsInterface, \Drupal\Component\Plugin\DependentPluginInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
Expanded class hierarchy of DateRangeDefaultFormatter
File
-
core/
modules/ datetime_range/ src/ Plugin/ Field/ FieldFormatter/ DateRangeDefaultFormatter.php, line 18
Namespace
Drupal\datetime_range\Plugin\Field\FieldFormatterView source
class DateRangeDefaultFormatter extends DateTimeDefaultFormatter {
use DateTimeRangeTrait;
/**
* {@inheritdoc}
*/
public static function defaultSettings() {
return static::dateTimeRangeDefaultSettings() + parent::defaultSettings();
}
/**
* {@inheritdoc}
*/
public function settingsForm(array $form, FormStateInterface $form_state) {
$form = parent::settingsForm($form, $form_state);
$form = $this->dateTimeRangeSettingsForm($form);
return $form;
}
/**
* {@inheritdoc}
*/
public function settingsSummary() {
return array_merge(parent::settingsSummary(), $this->dateTimeRangeSettingsSummary());
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.