You are here

protected function DateRecurViewsHooks::getFieldDateFormat in Recurring Dates Field 3.1.x

Same name and namespace in other branches
  1. 8.2 src/DateRecurViewsHooks.php \Drupal\date_recur\DateRecurViewsHooks::getFieldDateFormat()
  2. 3.x src/DateRecurViewsHooks.php \Drupal\date_recur\DateRecurViewsHooks::getFieldDateFormat()
  3. 3.0.x src/DateRecurViewsHooks.php \Drupal\date_recur\DateRecurViewsHooks::getFieldDateFormat()

Get date format of field storage.

Parameters

\Drupal\Core\Field\FieldStorageDefinitionInterface $fieldDefinition: A field definition.

Return value

string A date format.

1 call to DateRecurViewsHooks::getFieldDateFormat()
DateRecurViewsHooks::viewsData in src/DateRecurViewsHooks.php
Implements hook_views_data().

File

src/DateRecurViewsHooks.php, line 426

Class

DateRecurViewsHooks
Defines Views hooks.

Namespace

Drupal\date_recur

Code

protected function getFieldDateFormat(FieldStorageDefinitionInterface $fieldDefinition) : string {
  return $fieldDefinition
    ->getSetting('datetime_type') == DateTimeItem::DATETIME_TYPE_DATE ? DateTimeItemInterface::DATE_STORAGE_FORMAT : DateTimeItemInterface::DATETIME_STORAGE_FORMAT;
}