Return to Snippet

Revision: 27778
at June 23, 2010 09:59 by jonathanpglick


Initial Code
/*
 * Set the #type to date_popup and fill the element #default_value with a date adjusted to
 * the proper local timezone in datetime format (YYYY-MM-DD HH:MM:SS).
 *
 * #date_timezone
 *   The local timezone to be used to create this date.
 *
 * #date_format
 *   Unlike earlier versions of this popup, most formats will work.
 *
 * #date_increment
 *   Increment minutes and seconds by this amount, default is 1.
 *
 * #date_year_range
 *   The number of years to go back and forward in a year selector,
 *   default is -3:+3 (3 back and 3 forward).
 *
 */

Initial URL

                                

Initial Description
I can never remember how to trigger the Date Popup widget when writing a $form in Drupal so I've pulled out the instructions below.

This requires that the date_api, date_timezone and date_popup modules are all enabled.

Initial Title
Drupal Date Popup from Form API

Initial Tags

                                

Initial Language
PHP