Drupal 7 date_popup timepicker default value only

I am currently using Drupal 7 date_popup. One of the problems I ran into is the default value, which is not displayed if I selected the format only by time.

those.

$form['start'] = array( '#type' => 'date_popup', '#title' => t('Start'), '#default_value' => date("Ymd H:i:s", $start), '#date_format' => "Ymd h:i A", ); 

shows the correct default value, although it includes all date materials (in fact, I want to actually only have a timepicker). But if I changed '#date_format' to a time-only format, that is, to this:

  $form['start'] = array( '#type' => 'date_popup', '#title' => t('Start'), '#default_value' => date("Ymd H:i:s", $start), '#date_format' => "h:i A", ); 

There is no default value. How can I get the default value for date_popup for time format?

+4
source share
1 answer

There is a patch for a date popup module here that might be suitable

http://drupal.org/node/1037150

But this seems to be a mistake introduced when adding relative functionality only to time fields.

+1
source

All Articles