How to alter a form element to include it inside a fieldset
This code might help you out.

   $form['date_fieldset'] = array(
        '#type' =&gt; 'fieldset',
        '#title' =&gt; t('Select Start and End dates'),
        '#collapsible' =&gt; TRUE,
//        '#tree' =&gt; TRUE,
    );

    $form['date_fieldset']['date_inactive_start'] = array(
        '#title' =&gt; t('Start date'),
        '#type' =&gt; 'date_popup', // Provided by the date_popup module
        '#date_format' =&gt; 'd/m/Y',
        '#date_year_range' =&gt; '0:+1',
        '#required' =&gt; TRUE,
        '#size' =&gt; 8,
        '#default_value' =&gt; date('Y-m-d', time()), // Default value must be in 'Y-m-d' format.
    );

    $form['date_fieldset']['date_inactive_end'] = array(
        '#title' =&gt; t('End date'),
        '#type' =&gt; 'date_popup', // Provided by the date_popup module
        '#date_format' =&gt; 'd/m/Y',
        '#date_year_range' =&gt; '0:+2',
        '#required' =&gt; TRUE,
        '#size' =&gt; 8,
        '#default_value' =&gt; date('Y-m-d', time()), // Default value must be in 'Y-m-d' format.
    );