Display Date field as a normal texfield rather than as a fieldset

Public

I found this solution on codekarate.com: http://codekarate.com/blog/removing-fieldset-drupal-7-date-field

Get raw version
php
  1. /**
  2. * template.php
  3. */
  4. function MYTHEME_date_combo($variables) {
  5. return theme('form_element', $variables);
  6. }

Original hook in Date module

Get raw version
php
  1. function theme_date_combo($variables) {
  2. $element = $variables['element'];
  3. $field = field_info_field($element['#field_name']);
  4. $instance = field_info_instance($element['#entity_type'], $element['#field_name'], $element['#bundle']);
  5.  
  6. // Group start/end items together in fieldset.
  7. $fieldset = array(
  8. '#title' => t($element['#title']) . ' ' . ($element['#delta'] > 0 ? intval($element['#delta'] + 1) : ''),
  9. '#value' => '',
  10. '#description' => !empty($element['#fieldset_description']) ? $element['#fieldset_description'] : '',
  11. '#attributes' => array(),
  12. '#children' => $element['#children'],
  13. );
  14. return theme('fieldset', array('element' => $fieldset));
  15. }