Date popup default value doesn't work. Default value must be in format 'Y-m-d H:i:s' (more on #509036: Default date and date popup in a custom module).
Also, in balance_tracker.module I think that code:

  $form['date_from'] = array(
    '#type' => 'date_popup',
    '#title' => t('From'),
    '#default_value' => date($format, $user->created),
    '#date_format' => $format,
    '#date_label_position' => 'within',
    '#date_timezone' => 'America/Chicago',
    '#date_increment' => 15,
    '#date_year_range' => '-3:+3',
  );
  $form['date_to'] = array(
    '#type' => 'date_popup',
    '#title' => t('To'),
     '#default_value' => date($format, $_SERVER['REQUEST_TIME']),
    '#date_format' => $format,
    '#date_label_position' => 'within',
    '#date_timezone' => 'America/Chicago',
    '#date_increment' => 15,
    '#date_year_range' => '-3:+3',
  );

should be

  $form['date_from'] = array(
    '#type' => 'date_popup',
    '#title' => t('From'),
    '#default_value' => date('Y-m-d H:i:s', $from),
    '#date_format' => $format,
    '#date_label_position' => 'within',
    '#date_timezone' => 'America/Chicago',
    '#date_increment' => 15,
    '#date_year_range' => '-3:+3',
  );
  $form['date_to'] = array(
    '#type' => 'date_popup',
    '#title' => t('To'),
    '#default_value' => date('Y-m-d H:i:s', $to),
    '#date_format' => $format,
    '#date_label_position' => 'within',
    '#date_timezone' => 'America/Chicago',
    '#date_increment' => 15,
    '#date_year_range' => '-3:+3',
  );

I has changed $user->created to $form variable, and $_SERVER['REQUEST_TIME'] to $to variable.

Comments

brianV’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

asad.hasan’s picture

Very helpful post. Thank you.

netake.nilesh’s picture

Very helpful thanks.