1 date.tokens.inc | date_token_info() |
Implements hook_token_info().
File
- core/
modules/ date/ date.tokens.inc, line 10 - Token module integration.
Code
function date_token_info() {
// All date types can share the same date value type.
$info['types']['date-field-value'] = array(
'name' => t('Date field values'),
'description' => t('Tokens related to date field values.'),
'needs-data' => 'date-field-value',
'field-value' => TRUE,
);
// Provide two tokens: 'date' (the date or start-date), and 'end-date'.
$info['tokens']['date-field-value']['date'] = array(
'name' => t('Date'),
'description' => t('The date value.'),
'type' => 'date',
);
$info['tokens']['date-field-value']['end-date'] = array(
'name' => t('End Date'),
'description' => t('The End date value.'),
'type' => 'date',
);
return $info;
}