function time_field_token_info in Time Field For Drupal 8.x / 9.x 8
Same name and namespace in other branches
- 2.x time_field.tokens.inc \time_field_token_info()
Implements hook_token_info().
File
- ./
time_field.tokens.inc, line 16 - Token callbacks for the token module.
Code
function time_field_token_info() {
$info = [];
// Time tokens.
$info['types']['time'] = [
'name' => t('Time'),
'description' => t('Tokens related to time.'),
];
$info['tokens']['time']['format'] = [
'name' => t('Format'),
'description' => t('Value of the time.'),
];
// Time Range tokens.
$info['types']['time_range'] = [
'name' => t('Time Range'),
'description' => t('Tokens related to time.'),
];
$info['tokens']['time_range']['from'] = [
'name' => t('From'),
'description' => t('From value of the time.'),
];
$info['tokens']['time_range']['to'] = [
'name' => t('To'),
'description' => t('To value of the time.'),
];
return $info;
}