Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
Is that D6 or D7? – Valery Lourie Aug 8 '12 at 15:11
Looks tagged as D7 to me. – nedwardss Aug 8 '12 at 19:36
Sorry, I tagged it after this comment was posted. I thought I replied also.... must not have – gregghz Aug 8 '12 at 23:02

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,
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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