How do I collect an end date when creating a Date field in code? This is my field definition:

'ms_date' =&gt; array(
            'field_name' =&gt; 'ms_date',
            'type' =&gt; 'datetime',
            'cardinality' =&gt; 1,
            'settings' =&gt; array(
                'cache_count' =&gt; '4',
                'cache_enabled' =&gt; 0,
                'granularity' =&gt; array(
                    'day' =&gt; 'day',
                    'hour' =&gt; 'hour',
                    'minute' =&gt; 'minute',
                    'month' =&gt; 'month',
                    'second' =&gt; 'second',
                    'year' =&gt; 'year',
                ),
                'timezone_db' =&gt; 'UTC',
                'todate' =&gt; '',
                'tz_handling' =&gt; 'site',
            ),
        ),


and the instance definition:

 'ms_date' =&gt; array(
        'field_name' =&gt; 'ms_date',
        'entity_type' =&gt; 'node',
        'bundle' =&gt; 'ms_core',
        'label' =&gt; $t('date'),
        'widget' =&gt; array(
            'active' =&gt; 1,
            'module' =&gt; 'date',
            'settings' =&gt; array(
                'increment' =&gt; 15,
                'input_format' =&gt; 'm/d/Y - H:i:s',
                'input_format_custom' =&gt; '',
                'label_position' =&gt; 'above',
                'text_parts' =&gt; array(),
                'year_range' =&gt; '-3:+3',
            ),
            'type' =&gt; 'date_text',
            'weight' =&gt; '1',
        ),
        'settings' =&gt; array(
            'cache_count' =&gt; '4',
            'cache_enabled' =&gt; 0,
            'granularity' =&gt; array(
                'day' =&gt; 'day',
                'hour' =&gt; 'hour',
                'minute' =&gt; 'minute',
                'month' =&gt; 'month',
                'second' =&gt; 'second',
                'year' =&gt; 'year',
            ),
            'timezone_db' =&gt; 'UTC',
            'todate' =&gt; '',
            'tz_handling' =&gt; 'site',
        ),
    ),


I'm using these structures with field_create_field and field_create_instance respectively.

Currently the "Collect an end date" textfield is missing when I create this field. How do I enable it?
You just need to set the todate under the settings array, I believe the 2 options available are     

'todate' =&gt; 'optional',


and

'todate' =&gt; 'required',