[development] Hello from another developer/Want to add some
kb at 2bits.com
Sun Jan 29 02:10:56 UTC 2006
His question was about the lack of a field with type "time", and "date
time" in FAPI.
The forms allow a year, month, date, but not an hour, minute, second field.
On 1/28/06, Robert Douglass <rob at robshouse.net> wrote:
> Sammy Spets wrote:
> > AFAIK drupal doesn't have a time field with two dropdowns and a datetime
> > where the date and time fields are combined into one to fully utilize
> > the timestamp type of a DB.
> $form['effective_date'] = array(
> '#type' => 'date',
> '#title' => t('Effective date'),
> '#default_value' => $node->effective_date ? array('day' =>
> 'month' => $node->effective_date,
> 'year' => $node->effective_date)
> : array('day' => format_date(time(), 'custom', 'j'),
> 'month' => format_date(time(), 'custom', 'n'),
> 'year' => format_date(time(), 'custom', 'Y')),
> '#required' => FALSE);
More information about the development