Skip to content
Snippets Groups Projects
Commit a1839c7e authored by Michael Lee's avatar Michael Lee
Browse files

Add hook to change 'now' to YYYY-MM-DD format in event views

parent 38f88f0a
No related branches found
No related tags found
1 merge request!123Upgrading drupal/better_exposed_filters (6.0.5 => 6.0.6)
......@@ -1129,3 +1129,15 @@ function asc_bootstrap_bux_preprocess_views_view(&$vars)
//adds view name variable which is used to identify which view directory user is on (based off view id)
$vars['view_name'] = $vars['id'];
}
/**
* Converts the 'now' value to the required YYYY-MM-DD format for exposed filters
*/
function asc_bootstrap_bux_preprocess_views_exposed_form(&$variables)
{
if ($variables['form']['#id'] == 'views-exposed-form-events-page-1' || $variables['form']['#id'] == 'views-exposed-form-events-page-3') {
if ($variables['form']['field_evt_date_range_end_value_1']['#value'] === "now") {
$variables['form']['field_evt_date_range_end_value_1']['#value'] = date("Y-m-d");
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment