diff --git a/date_popup/date_popup.module b/date_popup/date_popup.module index 9c1ae2e..4882be1 100644 --- a/date_popup/date_popup.module +++ b/date_popup/date_popup.module @@ -326,8 +326,9 @@ function date_popup_process_date_part(&$element) { '#ajax' => !empty($element['#ajax']) ? $element['#ajax'] : FALSE, ); $sub_element['#value'] = $sub_element['#default_value']; - // TODO, figure out exactly when we want this description. In many places it is not desired. - $sub_element['#description'] = ' '. t('E.g., @date', array('@date' => date_format_date(date_now(), 'custom', date_popup_date_format($element)))); + // The description is not necessary for JavaScript users since the popup + // widget will automatically fill in the date in the correct format. + $sub_element['#description'] = '' . t('E.g., @date', array('@date' => date_format_date(date_now(), 'custom', date_popup_date_format($element)))) . ''; return $sub_element; } @@ -404,11 +405,17 @@ function date_popup_process_time_part(&$element) { ); $sub_element['#value'] = $sub_element['#default_value']; - // TODO, figure out exactly when we want this description. In many places it is not desired. + // Add a description. If the JavaScript-based wvega timepicker is being used, + // the description is not necessary, since the timepicker widget will + // automatically fill in the time in the correct format. $example_date = date_now(); date_increment_round($example_date, $element['#date_increment']); $sub_element['#description'] = t('E.g., @date', array('@date' => date_format_date($example_date, 'custom', date_popup_time_format($element)))); - return ($sub_element); + if ($element['#timepicker'] == 'wvega') { + $sub_element['#description'] = '' . $sub_element['#description'] . ''; + } + + return $sub_element; } /**