diff -Naur a/date_single_day.module b/date_single_day.module --- a/date_single_day.module 2010-05-26 23:21:05.000000000 +0300 +++ b/date_single_day.module 2010-08-24 02:35:23.037821071 +0300 @@ -59,7 +59,21 @@ } } } - } + } else if ($form_id == 'content_add_more_js') { + foreach ($form as $field_name => $field){ + foreach (array_keys($form[$field_name]) as $key) { + if (is_numeric($key)) { + if ( isset($form[$field_name][$key]['#type']) && in_array($form[$field_name][$key]['#type'] , array('date_popup','date_combo'))){ + $ct_fields = content_fields(NULL, $form[$field_name][$key]['#type']); + if (!empty($ct_fields[$field_name]['widget']['single_day'])) { + $form[$field_name][$key]['#after_build'][] = 'date_single_day_after_build'; + $form[$field_name][$key]['#theme'][] = 'date_single_day_element'; + } + } + } + } + } + } } /** @@ -67,7 +81,6 @@ */ function date_single_day_after_build($form, &$form_state) { //dsm($form); - // Hide the 'To' date element. // 'hidden' works; 'value' does not. $form['value2']['date']['#type'] = 'hidden';