diff --git a/README.txt b/README.txt index c4f465941f3cfa97fe4a29802b4ec8125be5492d..3951d76fa2e75e4085c9de3d1782c468d82cae04 100755 --- a/README.txt +++ b/README.txt @@ -105,12 +105,20 @@ set to "Australia, Victoria, Melbourne". When you use the Hierarchical Select widget you do NOT need to tick "Allow multiple values" on the contextual filter configuration panel. -GLOBAL FILTER FOR DATE OR DATE RANGE -==================================== -We assume that in addition to Views you have the Date module enabled. -If your content does not already have a date field attached, add one as per -normal via the Manage Fields tab on the content type page. You may pick any of -three Date types, i.e. plain, ISO or Unix Timestamp. Just be aware of this bug +GLOBAL FILTER FOR DATES OR DATE RANGES +====================================== +The "created (posted)" and "updated (modified)" node PROPERTIES are +architecturally different from Date FIELDS (discussed below). When used as +contextual filters "created" and "updated" are supported as single values only. +However you can use them as contextual ranges via the Views Contextual Range +Filter module. When used this way, you can enter ranges for "created" and +"updated" dates via the Range widget in Views Global Filter. + +As far as general date FIELDS go, here is how it works. +We assume that in addition to Views you have the Date module enabled. If your +content does not already have a date field attached, add one as per normal via +the Manage Fields tab on the content type page. You may pick any of the three +Date types, i.e. plain, ISO or Unix Timestamp. Just be aware of this bug in the Date module: drupal.org/project/node/1477180. So until this is fixed, maybe avoid Unix Timestamp. When prompted pick any of the available date selection widgets, e.g popup calendar or the triple select list. You may tick diff --git a/global_filter.blocks.inc b/global_filter.blocks.inc index a31eb67328ad3518f32daabe32fcb48291875aa5..a27678afe9488ff76058539bb8322cff7880f6da 100644 --- a/global_filter.blocks.inc +++ b/global_filter.blocks.inc @@ -84,14 +84,14 @@ function global_filter_block_configure($delta) { } } elseif (drupal_substr($filter_parameters[$key]['block'], -1) == $block_number) { - $form['all-filters'][$key] = _global_filter_configure_form($block_number, $key); + $form['all-filters'][$key] = _global_filter_configure_form($block_number, $key, $fieldset); $keys[] = $key; $fieldset++; } } // Generate empty form for optional extra filter. if (isset($first_free_key)) { - $form['all-filters'][$first_free_key] = _global_filter_configure_form($block_number, $first_free_key); + $form['all-filters'][$first_free_key] = _global_filter_configure_form($block_number, $first_free_key, $fieldset); $keys[] = $first_free_key; } return $form; @@ -104,11 +104,13 @@ function global_filter_block_configure($delta) { * the block number * @param int $filter_key * the filter key + * @param bool $expand_fieldset + * whetor to expand or collapse the fieldset holding the form * * @return array * the $form array */ -function _global_filter_configure_form($block_number, $filter_key) { +function _global_filter_configure_form($block_number, $filter_key, $expand_fieldset) { $num_filters = count(global_filter_get_filters_for_block($block_number)); $name = ($num_filters == 0) ? '' : global_filter_get_parameter($filter_key, 'name'); @@ -119,7 +121,7 @@ function _global_filter_configure_form($block_number, $filter_key) { '#title' => isset($name) ? t('Settings for global filter %name', array('%name' => $name)) : t('Optional additional global filter (currently not configured)'), '#type' => 'fieldset', '#collapsible' => TRUE, - '#collapsed' => TRUE, + '#collapsed' => $expand_fieldset, ); $form[$delta]['driver'] = array( diff --git a/widgets/global_filter.datewidget.inc b/widgets/global_filter.datewidget.inc index c408783b4b9b3d3ac34ed131f2cc8c7c1b6fc440..1adb848bab9b52ea1cb0e70947dd6f278bcdbb73 100644 --- a/widgets/global_filter.datewidget.inc +++ b/widgets/global_filter.datewidget.inc @@ -103,7 +103,7 @@ function global_filter_extract_date_range($form_state, $filter_key) { if (isset($values['value']['date'])) { // From date_popup. $date_string = $values['value']['date']; - $time_string = empty($values['value']['time']) ? '' : $values['value']['time']; + //$time_string = empty($values['value']['time']) ? '' : $values['value']['time']; if (!empty($date_string)) { // @todo Add support for hours and minutes $timestamp = strtotime($date_string);