diff --git a/date_views/includes/date_views_filter_handler_simple.inc b/date_views/includes/date_views_filter_handler_simple.inc index 6619c64..1d4e154 100644 --- a/date_views/includes/date_views_filter_handler_simple.inc +++ b/date_views/includes/date_views_filter_handler_simple.inc @@ -63,7 +63,7 @@ class date_views_filter_handler_simple extends views_handler_filter_date { $default_date = ''; if (empty($options)) { if ($this->options['is_grouped']) { - if ($this->options['group_info']['default_group'] == 'All') { + if ('All' == $this->options['group_info']['default_group']) { return ''; } $options = $this->options['group_info']['group_items'][$this->options['group_info']['default_group']]['value'][$prefix . '_group']; @@ -80,7 +80,7 @@ class date_views_filter_handler_simple extends views_handler_filter_date { } } - // This is a relative date that needs to be constructed from options like 'now'. + // This is a relative date. $default_option = $prefix == 'max' ? $options['default_to_date'] : $options['default_date']; if (isset($options[$prefix . '_choose_input_type']) && $options[$prefix . '_choose_input_type'] == 'relative' && !empty($default_option)) { $default_option = str_replace('now', 'today', $default_option); @@ -321,8 +321,14 @@ class date_views_filter_handler_simple extends views_handler_filter_date { } if ($which == 'all' || $which == 'minmax') { - $form['value'] += $this->date_parts_form($form_state, 'min', $source, $which, $this->operator_values(2), $identifier, 'default_date', $this->element_number); - $form['value'] += $this->date_parts_form($form_state, 'max', $source, $which, $this->operator_values(2), $identifier, 'default_to_date', $this->element_number); + $value2 = $this->operator_values(2); + + foreach (array( + 'min' => 'default_date', + 'max' => 'default_to_date', + ) as $type => $prop) { + $form['value'] += $this->date_parts_form($form_state, $type, $source, $which, $value2, $identifier, $prop, $this->element_number); + } } $this->element_number++;