You are here

function date_views_views_data_alter in Date 7.3

Same name and namespace in other branches
  1. 8 date_views/includes/date_views.views.inc \date_views_views_data_alter()
  2. 7.2 date_views/includes/date_views.views.inc \date_views_views_data_alter()

Implements hook_views_data_alter().

File

date_views/includes/date_views.views.inc, line 129
Defines date-related Views data and plugins:.

Code

function date_views_views_data_alter(&$data) {

  // Mark all the core date handlers as date fields.
  // This will identify all handlers that directly use the _date handlers,
  // will not pick up any that extend those handlers.
  foreach ($data as $base_table => &$table) {
    foreach ($table as $id => &$field) {
      foreach (array(
        'field',
        'sort',
        'filter',
        'argument',
      ) as $type) {
        if (isset($field[$type]) && isset($field[$type]['handler']) && $field[$type]['handler'] == 'views_handler_' . $type . '_date') {
          $field[$type]['is date'] = TRUE;
        }
      }
    }
  }
}