--- date_popup/date_popup.module.orig	Wed Nov 16 09:52:55 2011
+++ date_popup/date_popup.module	Wed Nov 16 10:26:26 2011
@@ -229,23 +229,27 @@
 /**
 * Element value callback for date_popup element.
 */
-function date_popup_element_value_callback($element, $input = FALSE, &$form_state) {
+function date_popup_element_value_callback($element, $input, &$form_state) {
   $granularity = date_format_order($element['#date_format']);
   $has_time = date_has_time($granularity);
   $date = NULL;
-  $return = $has_time ? array('date' => '', 'time' => '') : array('date' => '');
-  // For some reason I cannot fathom empty Popup widgets in exposed filters return
-  // an empty $input value that does not meet the !== FALSE test while text
-  // and select widgets do. So adjusting the test.
-  if ($input != FALSE) {
-    $return = $input;
+  if (is_array($input)) {
     $date = date_popup_input_date($element, $input);
   }
+  elseif (is_string($input) && !empty($input)) {
+    // We expect an array with date/time entries, but we also accept strings as
+    // input (e.g. on exposed Views forms that "remember" their last values).
+    $format = date_popup_date_format($element);
+    $format .= $has_time ? ' ' . date_popup_time_format($element) : '';
+    $date = new DateObject($input, $element['#date_timezone'], $format);
+  }
   elseif (!empty($element['#default_value'])) {
     $date = date_default_date($element);
   }
-  $return['date'] = date_is_date($date) && !$date->timeOnly ? $date->format(date_popup_date_format($element)) : '';
-  $return['time'] = date_is_date($date) && $has_time ? $date->format(date_popup_time_format($element)) : '';
+  $return = array (
+    'date' => date_is_date($date) && !$date->timeOnly ? $date->format(date_popup_date_format($element)) : '',
+    'time' => date_is_date($date) && $has_time ? $date->format(date_popup_time_format($element)) : '',
+  );
   return $return;
 
 }
@@ -447,6 +451,18 @@
 
   $input_exists = NULL;
   $input = drupal_array_get_nested_value($form_state['input'], $element['#parents'], $input_exists);
+  // We expect an array with date/time entries, but we also accept strings as
+  // input (after all, this function converts the value to a string ) which will
+  // be converted to an array.
+  if (is_string($input) && !empty($input)) {
+    $format = date_popup_date_format($element);
+    $format .= $has_time ? ' ' . date_popup_time_format($element) : '';
+    $date = new DateObject($input, $element['#date_timezone'], $format);
+    $input = array(
+      'date' => date_is_date($date) && !$date->timeOnly ? $date->format(date_popup_date_format($element)) : '',
+      'time' => date_is_date($date) && $has_time ? $date->format(date_popup_time_format($element)) : '',
+    );
+  }
 
   // If we have an all day flag on this date and the time is empty,
   // change the format to match the input value so we don't get validation errors.
