You are here

function date_views_views_data in Date 7

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

Implementation of hook_views_data()

File

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

Code

function date_views_views_data() {
  $data = array();
  $tables = module_invoke_all('date_views_tables');
  foreach ($tables as $base_table) {

    // The flexible date argument.
    $data[$base_table]['date_argument'] = array(
      'group' => t('Date'),
      'title' => t('Date (!base_table)', array(
        '!base_table' => $base_table,
      )),
      'help' => t('Filter any Views !base_table date field by a date argument, using any common ISO date/period format (i.e. YYYY, YYYY-MM, YYYY-MM-DD, YYYY-W99, YYYY-MM-DD--P3M, P90D, etc). ', array(
        '!base_table' => $base_table,
      )),
      'argument' => array(
        'handler' => 'date_views_argument_handler',
        'empty field name' => t('Undated'),
      ),
    );

    // The flexible date filter.
    $data[$base_table]['date_filter'] = array(
      'group' => t('Date'),
      'title' => t('Date (!base_table)', array(
        '!base_table' => $base_table,
      )),
      'help' => t('Filter any Views !base_table date field.', array(
        '!base_table' => $base_table,
      )),
      'filter' => array(
        'handler' => 'date_views_filter_handler',
        'empty field name' => t('Undated'),
      ),
    );
  }
  return $data;
}