I'm making a custom form and I would like to render a field that is just like the form that gets rendered for a Date with a jQuery Popup when editing a node.
I can't figure out how to build the array so that it will get rendered by drupal properly. I've tried a ton of different attempts, but this is what I've got currently:
$form['birthdate'] = array( '#title' => t("Offspring Birth Date"), '#id' => 'edit-field-filter-birthdate', '#type' => 'date_popup', '#default_value' => '2015-01-01 10:30:00', '#date_type' => DATE_DATETIME, '#date_timezone' => date_default_timezone(), '#date_format' => 'm-d-Y H:i', '#date_increment' => 1, '#date_year_range' => '-3:+3', ); $html = drupal_render($form);
The README.txt in the
date/date_popup module says:
To include a popup calendar in a form, use the type 'date_popup':
$form['date'] = array( '#type' => 'date_popup': '#title => t('My Date'), .... );
Set the #type to date_popup and fill the element #default_value with a date adjusted to the proper local timezone, or leave it blank.
However, all that ever gets rendered is just the
What am I doing wrong?