Include date module in custom module I have а custom module that will show some reports. It will have two textfields, so when a user clicks one of the fields "starting date" and "end date" a calendar will popup and will able to select the dates. After selecting the dates, it will show the table with the results.

I've been using "Date" module with content type/fields, but I've never done in a custom module.

If these are the two fields:

&lt;?php

$content['starting_date'] = array(
     '#type' =&gt; 'textfield',
     '#title' =&gt; 'Starting date',
);

$content['end_date'] = array(
     '#type' =&gt; 'textfield',
     '#title' =&gt; 'End date',
);

?&gt;


How can I show the popup calendar when a user clicks on some of the textfields and show the results?

I'm using Drupal 7.

EDIT: I'm marking Clive's answer, but the date_popup works only on forms, not custom fields.
Assuming you have the date popup module installed and enabled:

$form['starting_date'] = array(
  '#type' =&gt; 'date_popup',
  '#title' =&gt; 'Starting date',
  '#date_format' =&gt; 'd/m/Y',
  '#default_value' =&gt; date('Y-m-d'),
);