You are here

protected function EntityViewsData::processViewsDataForDatetime in Entity API 8

Corrects the views data for datetime base fields.

Based on datetime_field_views_data().

Parameters

string $table: The table name.

\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The field definition.

array $views_field: The views field data.

string $field_column_name: The field column being processed.

File

src/EntityViewsData.php, line 253

Class

EntityViewsData
Provides improvements to core's generic views integration for entities.

Namespace

Drupal\entity

Code

protected function processViewsDataForDatetime($table, FieldDefinitionInterface $field_definition, array &$views_field, $field_column_name) {
  if ($field_column_name == 'value') {
    $views_field['filter']['id'] = 'datetime';
    $views_field['argument']['id'] = 'datetime';
    $views_field['sort']['id'] = 'datetime';
  }
}