First time using date picker. Am learning a lot and it's been intense.

I have 2 date pickers in a row. I have tried putting various value in both #default_value & #value
Examples:

  • 12/15/2011
  • 12/15/2011 13:15

and just leaving it blank as well as having only #value (Drupal throws a warning if I don't have #value in there). Any suggestions on how to populate this? I'd like it to have the current date, but right now getting any date in there is impossible (I do know how to calc the current date in PHP)

$format = 'm/d/Y - H:i'; 
		//Start
  $start_settings = array (
  			'#date_format' => $format, 
  			'#default_value' => "",
  			'#value' => " ",
  			'#date_timezone' => 'UTC', 
  			'#title' => t('Start Date:'),
  			'#date_year_range' => '-3:+3',
  			'#date_increment' => 15,
  			'#parents' => array(),
  			'#attributes' => NULL,
  			'#id' => 'start');
  
	  //End Settings
  $end_settings = $start_settings;
  $end_settings['#title'] = t('End Date:');
  $end_settings['#id'] = 'end';

  $form['container']['controls']['sdate'] = date_popup_element_process($start_settings, $form_state, $form);
  $form['container']['controls']['edate'] = date_popup_element_process($end_settings, $form_state, $form);

Comments

jeditdog’s picture

I usually don't bump items and just figure it out, but I've got to admit I'm stumped. Any ideas? Anyone work with Datepicker? Do I need to add more code?

please help! & thanks!