Create custom field programmatically
You can add a regular select box style date field with the form api like this:

$form['date1'] = array(
  '#type' =&gt; 'date', 
  '#title' =&gt; t('Date 1'), 
  '#description' =&gt; t('Date 1 description'), 
);


Drupal core doesn't have a date popup FAPI element, but you can add jQuery UI datepicker to a regular text field as well

$form['date1'] = array(
  '#type' =&gt; 'textfield', 
  '#title' =&gt; t('Date 1'), 
  '#description' =&gt; t('Date 1 description'), 
  '#prefix' =&gt; '&lt;div class="datepicker-wrapper"&gt;',
  '#suffix' =&gt; '&lt;/div&gt;'
);

// Attach JS datepicker library and init js for textfield
$form['#attached']['library'][] = array('system', 'ui.datepicker');
$form['#attached']['js'] = array(
  drupal_get_path('theme', 'my_theme') . '/js/datepicker-init.js',
);


Then in your theme /js/datepicker-init.js

(function ($) {
  // Add calendar popup to date textfield
  Drupal.behaviors.setDatePicker = {
    attach: function(context, settings) {
      var options = {
        'dateFormat':'yy-mm-dd',
        'changeYear':true,
        'changeMonth':true
       };
      $(".datepicker-wrapper input").once('datepicker').datepicker(options);
    }
  };

})(jQuery);


The result is something like this: