1 date.api.php | hook_date_default_argument_alter(&$argument, &$value) |
Alter the default value for a date argument.
Parameters
object $argument: The argument object.
string $value: The default value created by the argument handler.
File
- core/
modules/ date/ date.api.php, line 15 - Hooks provided by the Date module.
Code
function hook_date_default_argument_alter(&$argument, &$value) {
$style_options = $style_options = $argument->view->display_handler->get_option('style_options');
if (!empty($style_options['track_date'])) {
$default_date = date_now();
$value = $default_date->format($argument->arg_format);
}
}