function commons_events_date_popup_element_process in Drupal Commons 7.3
Process date_popup field output.
This is an extension of the Date module's own processing.
See also
commons_events_element_info_alter()
1 string reference to 'commons_events_date_popup_element_process'
- commons_events_element_info_alter in modules/
commons/ commons_events/ commons_events.module - Implements hook_element_info_alter().
File
- modules/
commons/ commons_events/ commons_events.module, line 183
Code
function commons_events_date_popup_element_process($element, &$form_state, $form) {
// If a date_popup field is part of a larger range widget, simplify the
// output.
if (!empty($element['#field']['settings']['todate'])) {
foreach (array(
'date',
'time',
) as $type) {
if (!empty($element[$type])) {
// The description and title are unnecessary.
unset($element[$type]['#description']);
$element[$type]['#title'] = '';
}
}
}
return $element;
}