how can I replace the labels of start/end date for a date field via form_alter? the code below only works for the fieldset. The "to" needs to be removed.
$form['field_my_dates']['und']['0']['#title'] = t('My new title');
Code below not working neither, please help me to figure out how to do it! I forgot to mention that I'm using the popup widget for the date field.
function mywebform_date_combo_process_alter(&$element, &$form_state, &$context) {
if ($element['#field_name'] == 'field_my_dates') {
$element['value']['#date_title'] = 'From';
$element['value2']['#date_title'] = 'To';
$element['value2']['#title'] = t('');
}
}
function mywebform_date_part_label_date($vars) {
if ('field_my_dates' == $vars['element']['#field']['field_name']) {
return t($vars['element']['#date_title']);
} else {return t('Date');}
}