Date field with granularity of Month, Year in Exposed filter, how to alter the default value? I have a Date field with granularity of Month, Year in Exposed filter. Everything is working fine, but the month and year default values are shown as &quot;-Month&quot; and &quot;-Year&quot;.
Let me know how to alter the form to remove the &quot;-&quot; from Month and Year filter.
One method would be to alter the exposed filter form date_select form element. Add this to a custom module:

/**
 * Implements hook_form_alter().
 */
function MYMODULE_form_views_exposed_form_alter(&amp;$form, $form_state, $form_id) {
   $form['#after_build'][] = 'views_exposed_form_date_select_alter';
}

/**
 * Alter the label option on Year/Month selector
 */
function views_exposed_form_date_select_alter($form, &amp;$form_state) {
   $form['MY_DATE_FIELD']['year']['#options'][''] = 'Year';
   $form['MY_DATE_FIELD']['month']['#options'][''] = 'Month';
   return $form;
}