I'm attempting to create a custom content type for a module via hook_install. When I create a date type (from Date module), I want it to require an end date (there's a checkbox when you're setting up the field via the gui). This is the settings array for the field:

'settings' => array(
    'enddate_get' => 1,
    'enddate_required' => 1,

This isn't working (the widget is still only asking for one date), so I'm guess that I have the wrong settings. Does anyone know how to properly set this up?

  • Is that D6 or D7? Commented Aug 8, 2012 at 15:11
  • Looks tagged as D7 to me.
    – nedwardss
    Commented Aug 8, 2012 at 19:36
  • Sorry, I tagged it after this comment was posted. I thought I replied also.... must not have
    – gregghz
    Commented Aug 8, 2012 at 23:02

1 Answer 1


I believe you would need to setup the requirement on the form you are building for the custom content type so you would add this to the date_end form entry:

$form['CUSTOM_CONTENT_TYPE']['DATE_END'] = array(
  '#required' => TRUE,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.