function TimestampFormatter::defaultSettings

Same name in other branches
  1. 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\TimestampFormatter::defaultSettings()
  2. 8.9.x core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\TimestampFormatter::defaultSettings()
  3. 10 core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\TimestampFormatter::defaultSettings()

Overrides PluginSettingsBase::defaultSettings

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php, line 100

Class

TimestampFormatter
Plugin implementation of the 'timestamp' formatter.

Namespace

Drupal\Core\Field\Plugin\Field\FieldFormatter

Code

public static function defaultSettings() {
    return [
        'date_format' => 'medium',
        'custom_date_format' => '',
        'timezone' => '',
        'tooltip' => [
            'date_format' => 'long',
            'custom_date_format' => '',
        ],
        'time_diff' => [
            'enabled' => FALSE,
            'future_format' => '@interval hence',
            'past_format' => '@interval ago',
            'granularity' => 2,
            'refresh' => 60,
        ],
    ] + parent::defaultSettings();
}

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