Add an enddate to my date field programmatically I'm using the date field contrib module and added it to my custom module which creates a content type and its fields.

I've successfully added a field(+instance) of date with a popupcalendar to my contenttype with a lot of help of this comment. But I can't figure out how to get the end date working. It's only showing a first date, not value2. I've tried screwing around in the field settings by adding 'enddate'=&gt; 1 to no avail.

What setting should I use to get a start AND enddate to work in my field within my module?

Here are the fields I'm using(Its within a field collection which also works fine)

//Field collection
array(
    'field' =&gt; array(
        'field_name' =&gt; 'field_available_periods',
        'label' =&gt; $t('Available periods'),
        'cardinality' =&gt; -1,
        'type' =&gt; 'field_collection',
    ),
    'instance' =&gt; array(
        'field_name' =&gt; 'field_available_periods',
        'entity_type' =&gt; 'node',
        'bundle' =&gt; 'accommodation',
        'label' =&gt; $t('Available periods'),
        'description' =&gt; '',
        'widget' =&gt; array('type' =&gt; 'field_collection_embed'),
        'required' =&gt; 1,
    ),
),
array(
    'field' =&gt; array(
        'field_name' =&gt; 'field_van_tot',
        'type' =&gt; 'datetime',
        'label' =&gt; $t('From - Until'),
        'cardinality' =&gt; 1,
        'settings' =&gt; array(
            'granularity' =&gt; array(
                'year' =&gt; 'year',
                'month' =&gt; 'month',
                'day' =&gt; 'day',
            ),
            'enddate' =&gt; 1,
        ),
    ),
    'instance' =&gt; array(
        'field_name' =&gt; 'field_van_tot',
        'entity_type' =&gt; 'field_collection_item',
        'bundle' =&gt; 'field_available_periods',
        'label' =&gt; $t('From - Until'),
        'cardinality' =&gt; 1,
        'description' =&gt; '',
        'required' =&gt; FALSE,
        'widget' =&gt; array(
            'type' =&gt; 'date_popup',
            'settings' =&gt; array (
                'input_format' =&gt; 'Y-m-d',
                'year_range' =&gt; '-0:+2',

            ),
        ),
        'display' =&gt; array('default' =&gt; array('type' =&gt; 'date_default')),
        'settings' =&gt; array(
            'default_value' =&gt; 'blank',
            'default_format' =&gt; 'short',
            'default_value_code' =&gt; '',
            'default_value2' =&gt; 'blank',
            'default_value_code2' =&gt; '',

        ),
    )
),
Finally found it by changing the field settings' "todate":

'field' =&gt; array(
                'field_name' =&gt; 'field_van_tot',
                'type' =&gt; 'datetime',
                'label' =&gt; $t('From - Until'),
                'cardinality' =&gt; 1,
                'settings' =&gt; array(
                    'granularity' =&gt; array(
                        'year' =&gt; 'year',
                        'month' =&gt; 'month',
                        'day' =&gt; 'day',
                    ),
                    'todate' =&gt; 'required',
                ),
            ),