function date_views_views_data in Date 8
Same name and namespace in other branches
- 7.3 date_views/includes/date_views.views.inc \date_views_views_data()
- 7 date_views/includes/date_views.views.inc \date_views_views_data()
- 7.2 date_views/includes/date_views.views.inc \date_views_views_data()
Implements 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 = date_views_base_tables();
foreach ($tables as $base_table => $entity) {
// 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'),
'is date' => TRUE,
),
);
// 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'),
'is date' => TRUE,
),
);
}
return $data;
}