I am trying to get a default value in for the default value of a date_popup that exists within a fieldset and I have followed the other suggestions here but the value is always blank.
$format = 'm/d/Y';
$primary_start1 = null;
if(isset($vals["primary_start"])){
if("-1" != $vals["primary_start"]){
$primary_start1 = (int)$vals["primary_start"];
}
}
$form['dates']['primary']['primary_start'] = array(
'#title' => t('Start date'),
'#name' => 'primary_start',
'#type' => 'date_popup',
'#date_timezone' => FALSE,
'#default_value' => date('m/d/Y',$primary_start1),
'#date_format' => $format,
'#required' => TRUE,
'#date_label_position' => 'none',
);
The date comes in as a string, so I convert it to an int...which I know works because I dump the variable.
Am I doing anything wrong here?
Drupal v 7.22
Date Module - 7.x-2.6
Date Popup - 7.x-2.6