function date_api_views_data in Date 6.2
Same name and namespace in other branches
- 6 date_api.views.inc \date_api_views_data()
Implementation of hook_views_data().
File
- includes/
date_api.views.inc, line 121 - Defines date-related Views data and plugins:
Code
function date_api_views_data() {
$data = array();
$tables = module_invoke_all('date_api_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_api_argument_handler',
'empty field name' => t('Undated'),
'base' => $base_table,
),
);
// 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_api_filter_handler',
'empty field name' => t('Undated'),
'base' => $base_table,
),
);
}
return $data;
}