Change labels of date select fields I'm using the Form API to create a Date of Birth field with  lists for month, day and year.

$form['dob'] = array(
    '#type' =&gt; 'date_select',
    '#title' =&gt; t('Date of birth'),
    '#default_value' =&gt; '',
    '#date_format' =&gt; 'm-d-Y',
    '#date_label_position' =&gt; 'within',
    '#date_year_range' =&gt; '-100:+0',
    '#required' =&gt; TRUE,
);


Sine the default value is blank this outputs the following:



How can I alter the labels? Specifically I want to get rid of the '-' characters so it looks more like this
There might be better way to do this, but one method would be to run an #after_build function that will alter the first '' placeholder date label option to your liking. For example:

/**
 * Implements hook_form_alter().
 */
function MYMODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) {     
  $form['dob'] = array(
    '#type' =&gt; 'date_select',
    '#title' =&gt; t('Date of birth'),
    '#default_value' =&gt; '',
    '#date_format' =&gt; 'm-d-Y',
    '#date_label_position' =&gt; 'within',
    '#date_year_range' =&gt; '-100:+0',
    '#required' =&gt; TRUE,
  );
  $form['dob']['#after_build'][] = 'MYMODULE_myform_dob_after_build';
}

// Alter the date component option so the first placeholder element has the new label.
function MYMODULE_myform_dob_after_build(&amp;$form, &amp;$form_state) {
  $form['day']['#options'][''] = t('Day');
  $form['month']['#options'][''] = t('Month');
  $form['year']['#options'][''] = t('Year');
  return $form;
}