datetime_range.views.inc

Same filename in other branches
  1. 9 core/modules/datetime_range/datetime_range.views.inc
  2. 10 core/modules/datetime_range/datetime_range.views.inc
  3. 11.x core/modules/datetime_range/datetime_range.views.inc

Provides views data for the datetime_range module.

File

core/modules/datetime_range/datetime_range.views.inc

View source
<?php


/**
 * @file
 * Provides views data for the datetime_range module.
 */
use Drupal\field\FieldStorageConfigInterface;

/**
 * Implements hook_field_views_data().
 */
function datetime_range_field_views_data(FieldStorageConfigInterface $field_storage) {
    // Include datetime.views.inc file in order for helper function
    // datetime_type_field_views_data_helper() to be available.
    \Drupal::moduleHandler()->loadInclude('datetime', 'inc', 'datetime.views');
    // Get datetime field data for value and end_value.
    $data = datetime_type_field_views_data_helper($field_storage, [], 'value');
    $data = datetime_type_field_views_data_helper($field_storage, $data, 'end_value');
    return $data;
}

Functions

Title Deprecated Summary
datetime_range_field_views_data Implements hook_field_views_data().

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